From bdf9030a989cc93612c5739700e81b74c3a1c5a1 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Mon, 27 Apr 2020 18:30:49 -0400 Subject: [PATCH] Fix hostname extraction when URL has port Related issue: - https://github.com/uBlockOrigin/uBlock-issues/issues/1001 The issue affected only the uncloaking of canonical names, when the authority part of a URL contained port information. --- platform/chromium/vapi-common.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/chromium/vapi-common.js b/platform/chromium/vapi-common.js index 7fc1c96ad..30e09c577 100644 --- a/platform/chromium/vapi-common.js +++ b/platform/chromium/vapi-common.js @@ -150,7 +150,7 @@ vAPI.webextFlavor = { }; const reHostnameFromNetworkURL = - /^(?:http|ws|ftp)s?:\/\/([0-9a-z_][0-9a-z._-]*[0-9a-z])\//; + /^(?:http|ws|ftp)s?:\/\/([0-9a-z_][0-9a-z._-]*[0-9a-z])(?::\d+)?\//; vAPI.hostnameFromNetworkURL = function(url) { const matches = reHostnameFromNetworkURL.exec(url);