diff --git a/lib/url.js b/lib/url.js index 45155fee936bbf..3628f1dcfb9737 100644 --- a/lib/url.js +++ b/lib/url.js @@ -50,8 +50,8 @@ const autoEscape = ['\''].concat(unwise); const nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape); const hostEndingChars = ['/', '?', '#']; const hostnameMaxLen = 255; -const hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/; -const hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/; +const hostnamePartPattern = /^[+a-z0-9A-Z_-]{1,63}$/; +const hostnamePartStart = /^([+a-z0-9A-Z_-]{1,63})(.*)$/; // protocols that can allow "unsafe" and "unwise" chars. const unsafeProtocol = { 'javascript': true,