From cd613e5167a387a4bd6200640578e71b8914094e Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Wed, 13 Dec 2023 18:40:54 +0000 Subject: [PATCH] test: handle relative https redirect Fix `internet/test-inspector-help-page` to handle the relative redirect of `https://nodejs.org/en/docs/inspector` to `/en/docs/guides/debugging-getting-started`. Previously this URL redirected to an absolute URL. PR-URL: https://github.com/nodejs/node/pull/51121 Reviewed-By: Luigi Pinca Reviewed-By: Yagiz Nizipli --- test/internet/test-inspector-help-page.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/internet/test-inspector-help-page.js b/test/internet/test-inspector-help-page.js index 474483ed22ee23..ae06242405d5fc 100644 --- a/test/internet/test-inspector-help-page.js +++ b/test/internet/test-inspector-help-page.js @@ -18,7 +18,7 @@ function check(url, cb) { assert(res.statusCode >= 200 && res.statusCode < 400); if (res.statusCode >= 300) - return check(res.headers.location, cb); + return check(new URL(res.headers.location, url), cb); let result = '';