Take `method=` into account when evaluating whether a filter is pure hostname

Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2117
This commit is contained in:
Raymond Hill 2022-12-24 09:49:46 -05:00
parent af8cb06a96
commit d5f9c05d62
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 12 additions and 10 deletions

View File

@ -3421,6 +3421,7 @@ class FilterCompiler {
break; break;
case parser.OPTTokenMethod: case parser.OPTTokenMethod:
this.processMethodOption(val); this.processMethodOption(val);
this.optionUnitBits |= this.METHOD_BIT;
break; break;
case parser.OPTTokenInvalid: case parser.OPTTokenInvalid:
return false; return false;
@ -3900,16 +3901,17 @@ class FilterCompiler {
} }
} }
FilterCompiler.prototype.FROM_BIT = 0b0000000001; FilterCompiler.prototype.FROM_BIT = 0b00000000001;
FilterCompiler.prototype.TO_BIT = 0b0000000010; FilterCompiler.prototype.TO_BIT = 0b00000000010;
FilterCompiler.prototype.DENYALLOW_BIT = 0b0000000100; FilterCompiler.prototype.DENYALLOW_BIT = 0b00000000100;
FilterCompiler.prototype.HEADER_BIT = 0b0000001000; FilterCompiler.prototype.HEADER_BIT = 0b00000001000;
FilterCompiler.prototype.STRICT_PARTY_BIT = 0b0000010000; FilterCompiler.prototype.STRICT_PARTY_BIT = 0b00000010000;
FilterCompiler.prototype.CSP_BIT = 0b0000100000; FilterCompiler.prototype.CSP_BIT = 0b00000100000;
FilterCompiler.prototype.REMOVEPARAM_BIT = 0b0001000000; FilterCompiler.prototype.REMOVEPARAM_BIT = 0b00001000000;
FilterCompiler.prototype.REDIRECT_BIT = 0b0010000000; FilterCompiler.prototype.REDIRECT_BIT = 0b00010000000;
FilterCompiler.prototype.NOT_TYPE_BIT = 0b0100000000; FilterCompiler.prototype.NOT_TYPE_BIT = 0b00100000000;
FilterCompiler.prototype.IMPORTANT_BIT = 0b1000000000; FilterCompiler.prototype.IMPORTANT_BIT = 0b01000000000;
FilterCompiler.prototype.METHOD_BIT = 0b10000000000;
FilterCompiler.prototype.FILTER_OK = 0; FilterCompiler.prototype.FILTER_OK = 0;
FilterCompiler.prototype.FILTER_INVALID = 1; FilterCompiler.prototype.FILTER_INVALID = 1;