From 7bf5ac0ca2c674e74b2c7a7fc16a09b442808a38 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Sat, 9 Nov 2019 07:32:19 -0500 Subject: [PATCH] Code review of commit 4b34d29384dc Related issue: - https://github.com/uBlockOrigin/uBlock-issues/issues/778 Related commit: - https://github.com/gorhill/uBlock/commit/4b34d29384dc92df6eedecfe5f0ff8095d584e05 Mind that `report-uri` or `report-to` could be used somewhere in a hostname. --- src/js/static-net-filtering.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/static-net-filtering.js b/src/js/static-net-filtering.js index a909da5e7..8fea9b06a 100644 --- a/src/js/static-net-filtering.js +++ b/src/js/static-net-filtering.js @@ -2003,7 +2003,7 @@ const FilterParser = class { this.reIsolateHostname = /^(\*?\.)?([^\x00-\x24\x26-\x2C\x2F\x3A-\x5E\x60\x7B-\x7F]+)(.*)/; this.reHasUnicode = /[^\x00-\x7F]/; this.reWebsocketAny = /^ws[s*]?(?::\/?\/?)?\*?$/; - this.reBadCSP = /\breport-(?:to|uri)\b/; + this.reBadCSP = /(?:=|;)\s*report-(?:to|uri)\b/; this.reGoodToken = /[%0-9a-z]{1,}/g; this.reSeparator = /[\/^]/; this.reRegexToken = /[%0-9A-Za-z]{2,}/g; @@ -2272,7 +2272,7 @@ const FilterParser = class { continue; } // Used by Adguard: - // https://kb.adguard.com/en/general/how-to-create-your-own-ad-filters?aid=16593#empty-modifier + // https://kb.adguard.com/en/general/how-to-create-your-own-ad-filters#empty-modifier if ( opt === 'empty' || opt === 'mp4' ) { if ( this.redirect !== 0 ) { this.unsupported = true;