From cc949869a3a87397721eb7f20711f5ffaefbd383 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 d9ae17c5a887b2..5679eae4ebac83 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 = '';