Skip to content

Commit

Permalink
Take method= into account when evaluating whether a filter is pure …
Browse files Browse the repository at this point in the history
…hostname

Related issue:
- uBlockOrigin/uBlock-issues#2117
  • Loading branch information
gorhill committed Dec 24, 2022
1 parent af8cb06 commit d5f9c05
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/js/static-net-filtering.js
Original file line number Diff line number Diff line change
Expand Up @@ -3421,6 +3421,7 @@ class FilterCompiler {
break;
case parser.OPTTokenMethod:
this.processMethodOption(val);
this.optionUnitBits |= this.METHOD_BIT;
break;
case parser.OPTTokenInvalid:
return false;
Expand Down Expand Up @@ -3900,16 +3901,17 @@ class FilterCompiler {
}
}

FilterCompiler.prototype.FROM_BIT = 0b0000000001;
FilterCompiler.prototype.TO_BIT = 0b0000000010;
FilterCompiler.prototype.DENYALLOW_BIT = 0b0000000100;
FilterCompiler.prototype.HEADER_BIT = 0b0000001000;
FilterCompiler.prototype.STRICT_PARTY_BIT = 0b0000010000;
FilterCompiler.prototype.CSP_BIT = 0b0000100000;
FilterCompiler.prototype.REMOVEPARAM_BIT = 0b0001000000;
FilterCompiler.prototype.REDIRECT_BIT = 0b0010000000;
FilterCompiler.prototype.NOT_TYPE_BIT = 0b0100000000;
FilterCompiler.prototype.IMPORTANT_BIT = 0b1000000000;
FilterCompiler.prototype.FROM_BIT = 0b00000000001;
FilterCompiler.prototype.TO_BIT = 0b00000000010;
FilterCompiler.prototype.DENYALLOW_BIT = 0b00000000100;
FilterCompiler.prototype.HEADER_BIT = 0b00000001000;
FilterCompiler.prototype.STRICT_PARTY_BIT = 0b00000010000;
FilterCompiler.prototype.CSP_BIT = 0b00000100000;
FilterCompiler.prototype.REMOVEPARAM_BIT = 0b00001000000;
FilterCompiler.prototype.REDIRECT_BIT = 0b00010000000;
FilterCompiler.prototype.NOT_TYPE_BIT = 0b00100000000;
FilterCompiler.prototype.IMPORTANT_BIT = 0b01000000000;
FilterCompiler.prototype.METHOD_BIT = 0b10000000000;

FilterCompiler.prototype.FILTER_OK = 0;
FilterCompiler.prototype.FILTER_INVALID = 1;
Expand Down

0 comments on commit d5f9c05

Please sign in to comment.