summaryrefslogtreecommitdiff
path: root/lib/url.js
diff options
context:
space:
mode:
authorTimothy Gu <timothygu99@gmail.com>2017-02-24 17:57:45 -0800
committerTimothy Gu <timothygu99@gmail.com>2017-02-28 18:32:01 -0800
commitc2a302c50b3787666339371140ad2c13d50d817a (patch)
treee5cc9f551860b3c55741ae11a5b466f2e1f0a503 /lib/url.js
parenta52050877c91509f654dd6b2519c0132b7792578 (diff)
downloadandroid-node-v8-c2a302c50b3787666339371140ad2c13d50d817a.tar.gz
android-node-v8-c2a302c50b3787666339371140ad2c13d50d817a.tar.bz2
android-node-v8-c2a302c50b3787666339371140ad2c13d50d817a.zip
src: do not ignore IDNA conversion error
Old behavior can be restored using a special `lenient` mode, as used in the legacy URL parser. PR-URL: https://github.com/nodejs/node/pull/11549 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> 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.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/url.js b/lib/url.js
index 5d59d3c10f..2db780c7eb 100644
--- a/lib/url.js
+++ b/lib/url.js
@@ -319,7 +319,10 @@ Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {
// It only converts parts of the domain name that
// have non-ASCII characters, i.e. it doesn't matter if
// you call it with a domain that already is ASCII-only.
- this.hostname = toASCII(this.hostname);
+
+ // Use lenient mode (`true`) to try to support even non-compliant
+ // URLs.
+ this.hostname = toASCII(this.hostname, true);
}
var p = this.port ? ':' + this.port : '';