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.
The internet/test-inspector-help-page
test has been failing for about a week:
- On node-daily-master in Jenkins since 6 December 2023, e.g.
- On GitHub Actions, e.g.
=== release test-inspector-help-page ===
Path: internet/test-inspector-help-page
node:internal/url:787
this.#updateContext(bindingUrl.parse(input, base));
^
TypeError: Invalid URL
at new URL (node:internal/url:787:36)
at request (node:https:366:32)
at Object.get (node:https:414:15)
at check (/home/runner/work/node/node/test/internet/test-inspector-help-page.js:17:9)
at ClientRequest.<anonymous> (/home/runner/work/node/node/test/internet/test-inspector-help-page.js:21:14)
at ClientRequest.<anonymous> (/home/runner/work/node/node/test/common/index.js:476:15)
at Object.onceWrapper (node:events:634:26)
at ClientRequest.emit (node:events:519:28)
at HTTPParser.parserOnIncomingClient [as onIncoming] (node:_http_client:6[93](https://github.com/nodejs/node/actions/runs/7108379296/job/19351546344#step:6:94):27)
at HTTPParser.parserOnHeadersComplete (node:_http_common:119:17) {
code: 'ERR_INVALID_URL',
input: '/en/docs/guides/debugging-getting-started'
}
Node.js v22.0.0-pre
Command: out/Release/node /home/runner/work/node/node/test/internet/test-inspector-help-page.js
The test attempts to connect to https://nodejs.org/en/docs/inspector (output from node --inspect -e ""
), and then to res.headers.location
which comes back as /en/docs/guides/debugging-getting-started
.
Presumably something changed around then on the website so that the redirect is now to a relative URL rather than an absolute one. The test itself hasn't changed in over a year.