Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimothy Gu <timothygu99@gmail.com>2021-05-20 10:42:07 +0300
committerDanielle Adams <adamzdanielle@gmail.com>2021-05-31 22:34:51 +0300
commit7773d58f1a2bf9dd4a741109d4f698196137deff (patch)
tree7c7289c38a7351ad37d526f06a0ef61127ac2778 /src
parente9be2095cf1c0d45429a9301f4f29001b26b1a8e (diff)
url: exit early when : delimiter is seen in hostname
This aligns with an upstream spec change. PR-URL: https://github.com/nodejs/node/pull/38742 Fixes: https://github.com/nodejs/node/issues/38710 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/node_url.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/node_url.cc b/src/node_url.cc
index 554ee855848..3b4c2e690ee 100644
--- a/src/node_url.cc
+++ b/src/node_url.cc
@@ -1766,6 +1766,9 @@ void URL::Parse(const char* input,
url->flags |= URL_FLAGS_FAILED;
return;
}
+ if (state_override == kHostname) {
+ return;
+ }
url->flags |= URL_FLAGS_HAS_HOST;
if (!ParseHost(buffer, &url->host, special)) {
url->flags |= URL_FLAGS_FAILED;
@@ -1773,9 +1776,6 @@ void URL::Parse(const char* input,
}
buffer.clear();
state = kPort;
- if (state_override == kHostname) {
- return;
- }
} else if (ch == kEOL ||
ch == '/' ||
ch == '?' ||