From a098afd378765d5f0cb19f3f0bd2390816ce3bf8 Mon Sep 17 00:00:00 2001 From: Sebastian Mayr Date: Thu, 30 Apr 2015 03:27:26 +0100 Subject: [PATCH] punycode.js doesn't map uppercase letters They follow a different RFC than the URL spec references, so we'll have to lowercase ourselves first. --- lib/url.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/url.js b/lib/url.js index a47b071..b1603a3 100644 --- a/lib/url.js +++ b/lib/url.js @@ -106,7 +106,7 @@ function parseHost(input, isUnicode) { } let domain = decodeURIComponent(input); - let asciiDomain = punycode.toASCII(domain); + let asciiDomain = punycode.toASCII(domain.toLowerCase()); if (domain.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|%|\/|:|\?|@|\[|\\|\]/) !== -1) { throw new TypeError("Invalid Host"); }