summaryrefslogtreecommitdiff
path: root/lib/internal/url.js
diff options
context:
space:
mode:
authorAyush Gupta <AyushG3112@gmail.com>2018-05-03 00:21:20 +0530
committerRuben Bridgewater <ruben@bridgewater.de>2018-05-18 15:24:05 +0200
commit11892b0b6422f6e983bfbde7ba342942dd2e2297 (patch)
tree4bae9cc12f532892305c971386253be5ce316cb5 /lib/internal/url.js
parent9b24be1340b702131efcf3fd7a65b7ac4c269711 (diff)
downloadandroid-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 'lib/internal/url.js')
-rw-r--r--lib/internal/url.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/internal/url.js b/lib/internal/url.js
index d9daef1524..7a67fe2f15 100644
--- a/lib/internal/url.js
+++ b/lib/internal/url.js
@@ -46,6 +46,7 @@ const {
URL_FLAGS_HAS_PATH,
URL_FLAGS_HAS_QUERY,
URL_FLAGS_HAS_USERNAME,
+ URL_FLAGS_IS_DEFAULT_SCHEME_PORT,
URL_FLAGS_SPECIAL,
kFragment,
kHost,
@@ -276,7 +277,7 @@ function onParsePortComplete(flags, protocol, username, password,
function onParseHostComplete(flags, protocol, username, password,
host, port, path, query, fragment) {
onParseHostnameComplete.apply(this, arguments);
- if (port !== null)
+ if (port !== null || ((flags & URL_FLAGS_IS_DEFAULT_SCHEME_PORT) !== 0))
onParsePortComplete.apply(this, arguments);
}