From c119be04edf9bf054c35864859815a5d96bb0afb Mon Sep 17 00:00:00 2001 From: gorhill Date: Tue, 7 Apr 2015 09:41:08 -0400 Subject: [PATCH] this fixes hostnames with trailing dot as seen on nytimes.com --- src/js/uritools.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/uritools.js b/src/js/uritools.js index d47a913f2..fe9908c7c 100644 --- a/src/js/uritools.js +++ b/src/js/uritools.js @@ -49,7 +49,7 @@ var reRFC3986 = /^([^:\/?#]+:)?(\/\/[^\/?#]*)?([^?#]*)(\?[^#]*)?(#.*)?/; // Derived var reSchemeFromURI = /^[^:\/?#]+:/; var reAuthorityFromURI = /^(?:[^:\/?#]+:)?(\/\/[^\/?#]+)/; -var reCommonHostnameFromURL = /^https?:\/\/([0-9a-z_][0-9a-z._-]+)\//; +var reCommonHostnameFromURL = /^https?:\/\/([0-9a-z_][0-9a-z._-]*[0-9a-z])\//; // These are to parse authority field, not parsed by above official regex // IPv6 is seen as an exception: a non-compatible IPv6 is first tried, and