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
diff options
context:
space:
mode:
authorTimothy Gu <timothygu99@gmail.com>2021-05-20 10:42:07 +0300
committerTimothy Gu <timothygu99@gmail.com>2021-05-23 03:46:05 +0300
commitbf06daa6567067b0a1a1468dda5f2a2b0fcb8539 (patch)
tree80f202331448db1b6710df7768488365346ce555 /src/node_url.cc
parent7afa7b9ab34b4f7c7ddf113e5c9e9b4ff6c60915 (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/node_url.cc')
-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 == '?' ||