summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLuigi Pinca <luigipinca@gmail.com>2018-04-01 08:52:10 +0200
committerLuigi Pinca <luigipinca@gmail.com>2018-04-10 09:05:20 +0200
commitfa2d43bd3efec57d5b17f0a2fa60e0d38ed0dad6 (patch)
tree8af7b705ed95e9f6af976a017880db902f890982 /test
parentd1156da815d878df9252cd0b0489c27c38e63511 (diff)
downloadandroid-node-v8-fa2d43bd3efec57d5b17f0a2fa60e0d38ed0dad6.tar.gz
android-node-v8-fa2d43bd3efec57d5b17f0a2fa60e0d38ed0dad6.tar.bz2
android-node-v8-fa2d43bd3efec57d5b17f0a2fa60e0d38ed0dad6.zip
url: make urlToOptions() handle IPv6 literals
Strip the enclosing square brackets from the parsed hostname. PR-URL: https://github.com/nodejs/node/pull/19720 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'test')
-rw-r--r--test/parallel/test-whatwg-url-properties.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/parallel/test-whatwg-url-properties.js b/test/parallel/test-whatwg-url-properties.js
index d6caae511a..230315a70e 100644
--- a/test/parallel/test-whatwg-url-properties.js
+++ b/test/parallel/test-whatwg-url-properties.js
@@ -143,6 +143,9 @@ assert.strictEqual(url.searchParams, oldParams);
assert.strictEqual(opts.pathname, '/aaa/zzz');
assert.strictEqual(opts.search, '?l=24');
assert.strictEqual(opts.hash, '#test');
+
+ const { hostname } = urlToOptions(new URL('http://[::1]:21'));
+ assert.strictEqual(hostname, '::1');
}
// Test special origins