1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-10-04 16:47:15 +02:00

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.
This commit is contained in:
Raymond Hill 2020-04-27 18:30:49 -04:00
parent 6259f88598
commit bdf9030a98
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -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);