mirror of
https://github.com/gorhill/uBlock.git
synced 2024-09-02 09:09:38 +02:00
fix bad regex: all URLs were seen as needing punycoding
This commit is contained in:
parent
5626b5005a
commit
04a41d8b22
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user