diff options
author | Ayush Gupta <AyushG3112@gmail.com> | 2018-05-03 00:21:20 +0530 |
---|---|---|
committer | Ruben Bridgewater <ruben@bridgewater.de> | 2018-05-18 15:24:05 +0200 |
commit | 11892b0b6422f6e983bfbde7ba342942dd2e2297 (patch) | |
tree | 4bae9cc12f532892305c971386253be5ce316cb5 /test | |
parent | 9b24be1340b702131efcf3fd7a65b7ac4c269711 (diff) | |
download | android-node-v8-11892b0b6422f6e983bfbde7ba342942dd2e2297.tar.gz android-node-v8-11892b0b6422f6e983bfbde7ba342942dd2e2297.tar.bz2 android-node-v8-11892b0b6422f6e983bfbde7ba342942dd2e2297.zip |
url: introduce `URL_FLAGS_IS_DEFAULT_SCHEME_PORT` flag
Introduce `URL_FLAGS_IS_DEFAULT_SCHEME_PORT` flag which is retured
when the parser detects that the port passed is the default port
for that scheme.
PR-URL: https://github.com/nodejs/node/pull/20479
Fixes: https://github.com/nodejs/node/issues/20465
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'test')
-rw-r--r-- | test/fixtures/url-setter-tests.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/test/fixtures/url-setter-tests.js b/test/fixtures/url-setter-tests.js index 289812cb7e..1e460ff2d8 100644 --- a/test/fixtures/url-setter-tests.js +++ b/test/fixtures/url-setter-tests.js @@ -2,7 +2,7 @@ /* The following tests are copied from WPT. Modifications to them should be upstreamed first. Refs: - https://github.com/w3c/web-platform-tests/blob/ed4bb727ed/url/setters_tests.json + https://github.com/w3c/web-platform-tests/blob/f0fe479/url/setters_tests.json License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html */ module.exports = @@ -728,6 +728,17 @@ module.exports = } }, { + "comment": "Port number is removed if new port is scheme default and existing URL has a non-default port", + "href": "http://example.net:8080", + "new_value": "example.com:80", + "expected": { + "href": "http://example.com/", + "host": "example.com", + "hostname": "example.com", + "port": "" + } + }, + { "comment": "Stuff after a / delimiter is ignored", "href": "http://example.net/path", "new_value": "example.com/stuff", |