diff options
author | Timothy Gu <timothygu99@gmail.com> | 2017-05-04 23:43:47 -0700 |
---|---|---|
committer | Timothy Gu <timothygu99@gmail.com> | 2017-05-19 23:19:57 -0700 |
commit | 841bb4c61f07a5c2bf818a3b985ea0f88257210e (patch) | |
tree | a60f5452529fbfe24f1d0be0616c3ff369eb9987 /src/node_url.h | |
parent | 525497596a51ef2e6653b930ca525046d27c9fd5 (diff) | |
download | node-new-841bb4c61f07a5c2bf818a3b985ea0f88257210e.tar.gz |
url: fix C0 control and whitespace handling
PR-URL: https://github.com/nodejs/node/pull/12846
Fixes: https://github.com/nodejs/node/issues/12825
Refs: https://github.com/w3c/web-platform-tests/pull/5792
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Diffstat (limited to 'src/node_url.h')
-rw-r--r-- | src/node_url.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/node_url.h b/src/node_url.h index 49bfb264e8..72ac366ec1 100644 --- a/src/node_url.h +++ b/src/node_url.h @@ -81,30 +81,35 @@ struct url_data { class URL { public: static void Parse(const char* input, - const size_t len, + size_t len, enum url_parse_state state_override, struct url_data* url, + bool has_url, const struct url_data* base, bool has_base); URL(const char* input, const size_t len) { - Parse(input, len, kUnknownState, &context_, nullptr, false); + Parse(input, len, kUnknownState, &context_, false, nullptr, false); } URL(const char* input, const size_t len, const URL* base) { if (base != nullptr) - Parse(input, len, kUnknownState, &context_, &(base->context_), true); + Parse(input, len, kUnknownState, + &context_, false, + &(base->context_), true); else - Parse(input, len, kUnknownState, &context_, nullptr, false); + Parse(input, len, kUnknownState, &context_, false, nullptr, false); } URL(const char* input, const size_t len, const char* base, const size_t baselen) { if (base != nullptr && baselen > 0) { URL _base(base, baselen); - Parse(input, len, kUnknownState, &context_, &(_base.context_), true); + Parse(input, len, kUnknownState, + &context_, false, + &(_base.context_), true); } else { - Parse(input, len, kUnknownState, &context_, nullptr, false); + Parse(input, len, kUnknownState, &context_, false, nullptr, false); } } |