-
-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
They follow a different RFC than the URL spec references, so we'll have to lowercase ourselves first.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -106,7 +106,7 @@ function parseHost(input, isUnicode) { | |
} | ||
|
||
let domain = decodeURIComponent(input); | ||
let asciiDomain = punycode.toASCII(domain); | ||
let asciiDomain = punycode.toASCII(domain.toLowerCase()); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
domenic
Member
|
||
if (domain.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|%|\/|:|\?|@|\[|\\|\]/) !== -1) { | ||
throw new TypeError("Invalid Host"); | ||
} | ||
|
3 comments
on commit a098afd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They follow a different RFC than the URL spec references, so we'll have to lowercase ourselves first.
This seems kind of bad. @mathiasbynens, is there an IDNA.js or similar?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See mathiasbynens/todo#9.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oof, OK, that sounds like a lot of work. And @jcranmer's comment at mathiasbynens/todo#9 (comment) is not very heartening either.
Hmm, isn’t
.toLowerCase()
still incorrect? It doesn’t perform full case folding as per the Unicode standard.