1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-07-19 03:05:22 +02:00

fix bad regex: all URLs were seen as needing punycoding

This commit is contained in:
gorhill 2017-09-13 13:08:31 -04:00
parent 5626b5005a
commit 04a41d8b22
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -93,16 +93,13 @@ vAPI.net.registerListeners = function() {
};
var punycode = self.punycode;
var reMustNormalizeHostname = /[^0-9a-z._-]/;
var reAsciiHostname = /^https?:\/\/[0-9a-z_.:@-]+[/?#]/;
var parsedURL = new URL('about:blank');
var normalizeRequestDetails = function(details) {
details.tabId = details.tabId.toString();
if (
mustPunycode === true &&
reMustNormalizeHostname.test(details.url) === true
) {
if ( mustPunycode && !reAsciiHostname.test(details.url) ) {
parsedURL.href = details.url;
details.url = details.url.replace(
parsedURL.hostname,