summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimothy Gu <timothygu99@gmail.com>2018-11-13 15:53:35 -0800
committerRich Trott <rtrott@gmail.com>2018-12-01 08:53:05 -0800
commitf2be20b7353baacf0094c78693b8b4ffd7e94530 (patch)
tree9f8a2d73f5268dd36ce2400ea0d576cf022fbac2 /src
parent639f6411a76d010b1807fd1b6e78b8ba894a281e (diff)
downloadandroid-node-v8-f2be20b7353baacf0094c78693b8b4ffd7e94530.tar.gz
android-node-v8-f2be20b7353baacf0094c78693b8b4ffd7e94530.tar.bz2
android-node-v8-f2be20b7353baacf0094c78693b8b4ffd7e94530.zip
url: reuse existing context in href setter
Correctness-wise, this removes side effects in the href setter if parsing fails. Style-wise, this allows removing the parse() wrapper function around C++ _parse(). Also fix an existing bug with whitespace trimming in C++ that was previously circumvented by additionally trimming the input in JavaScript. Fixes: https://github.com/nodejs/node/issues/24345 Refs: https://github.com/nodejs/node/pull/24218#issuecomment-438476591 PR-URL: https://github.com/nodejs/node/pull/24495 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/node_url.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/node_url.cc b/src/node_url.cc
index 39007f9523..57be5418aa 100644
--- a/src/node_url.cc
+++ b/src/node_url.cc
@@ -1376,6 +1376,7 @@ void URL::Parse(const char* input,
else
break;
}
+ input = p;
len = end - p;
}