diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2012-10-23 16:06:04 +0400 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2012-10-25 03:06:00 +0400 |
commit | de0303d3ad530d6a4f9b48fb5ac46795cfe4663f (patch) | |
tree | 516c9bf48bfa10135cabef45f1888be24058e490 /lib | |
parent | 82a72e9591b6970685a113a59a647fb79fc104ca (diff) |
url: parse hostnames that start with - or _
Allow hostnames like '-lovemonsterz.tumblr.com' and '_jabber._tcp.google.com'.
Fixes #4177.
Diffstat (limited to 'lib')
-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 50eb8b20f66..77686ed0f60 100644 --- a/lib/url.js +++ b/lib/url.js @@ -50,8 +50,8 @@ var protocolPattern = /^([a-z0-9.+-]+:)/i, .concat(unwise).concat(autoEscape), nonAuthChars = ['/', '@', '?', '#'].concat(delims), hostnameMaxLen = 255, - hostnamePartPattern = /^[a-zA-Z0-9][a-z0-9A-Z_-]{0,62}$/, - hostnamePartStart = /^([a-zA-Z0-9][a-z0-9A-Z_-]{0,62})(.*)$/, + hostnamePartPattern = /^[a-z0-9A-Z_-]{0,63}$/, + hostnamePartStart = /^([a-z0-9A-Z_-]{0,63})(.*)$/, // protocols that can allow "unsafe" and "unwise" chars. unsafeProtocol = { 'javascript': true, |