Skip to content

Commit

Permalink
test: disable test for IPv6 with zone identifier
Browse files Browse the repository at this point in the history
The built-in URL class dropped support for zone identifiers in IPv6
address literals in Node.js 20.  Calling the URL constructor with a URL
containing a zone identifier causes ERR_INVALID_URL to be thrown.  This
is likely a result of switching to version 2.0 of the Ada URL parser in
<nodejs/node#47339>.  The behavior aligns with
how [IPv6 address is defined in the WHATWG URL
Standard](https://url.spec.whatwg.org/#concept-ipv6), which notes that

> Support for <zone_id> is intentionally omitted.

As explained in the issue tracker:

https://www.w3.org/Bugs/Public/show_bug.cgi?id=27234#c2
whatwg/url#392

Skip this test, since this URL format is not supported.  If it's
necessary to support SCP-like git URLs with zone identifiers, we'll need
to roll our own support.

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
  • Loading branch information
kevinoid committed Sep 12, 2023
1 parent d6d0cb8 commit f0627fa
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test/lib/git-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,14 @@ describe('gitUtils', () => {
);
});

it('parses SCP-like URL with IPv6 zone index like ssh: URL', () => {
// Support for zone index in IPv6 address was dropped in Node.js 20,
// probably by Ada 2.0 <https://github.com/nodejs/node/pull/47339>
// to align with how IPv6 address is defined in the WHATWG URL Standard:
// https://url.spec.whatwg.org/#concept-ipv6
// See:
// https://www.w3.org/Bugs/Public/show_bug.cgi?id=27234#c2
// https://github.com/whatwg/url/issues/392
xit('parses SCP-like URL with IPv6 zone index like ssh: URL', () => {
const testUrl = 'user@[fe80::1ff:fe23:4567:890a%eth2]:foo/bar.git';
assert.deepStrictEqual(
gitUtils.parseGitUrl(testUrl),
Expand Down

0 comments on commit f0627fa

Please sign in to comment.