diff options
author | Justin Beckwith <justin.beckwith@gmail.com> | 2017-06-10 21:25:45 -0700 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2017-06-13 12:25:19 -0700 |
commit | c88ba036b46e56f11d56c4679adbd9ff66bce645 (patch) | |
tree | 80e286c9498f4081483da5310fa9ac528f43aaec /lib/url.js | |
parent | add4b0ab8cc0ec663cd4623e9032c14830873760 (diff) | |
download | android-node-v8-c88ba036b46e56f11d56c4679adbd9ff66bce645.tar.gz android-node-v8-c88ba036b46e56f11d56c4679adbd9ff66bce645.tar.bz2 android-node-v8-c88ba036b46e56f11d56c4679adbd9ff66bce645.zip |
url: ensure search property is consistently null vs empty
PR-URL: https://github.com/nodejs/node/pull/13606
Fixes: https://github.com/nodejs/node/issues/13404
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Diffstat (limited to 'lib/url.js')
-rw-r--r-- | lib/url.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/url.js b/lib/url.js index 6227c8a057..8a76d1fc10 100644 --- a/lib/url.js +++ b/lib/url.js @@ -196,7 +196,7 @@ Url.prototype.parse = function parse(url, parseQueryString, slashesDenoteHost) { this.query = this.search.slice(1); } } else if (parseQueryString) { - this.search = ''; + this.search = null; this.query = Object.create(null); } return this; @@ -389,7 +389,7 @@ Url.prototype.parse = function parse(url, parseQueryString, slashesDenoteHost) { } } else if (parseQueryString) { // no query string, but parseQueryString still requested - this.search = ''; + this.search = null; this.query = Object.create(null); } |