Commit aaf35d9
committed
Improve compatibility of
The `uritransform=` option will now be converted to a proper DNR
rule when the following condition are fulfilled:
- The value of the `uritransform` option matches `//[replacement]/`,
i.e. the pattern to match is empty, and only the replacement part is
provided.
- The filter pattern is a regex.
Is such case, the DNR rule will be a `redirect` making use of the
`regexSubstitution` property.
In case the above conditions are not fulfilled, the filter will
be discarded as incompatible with DNR syntax (as was the case
before).
This is potentially a breaking change, in cases where a filter
assumed that the part to match was the start of the path part of
a URL.
A reminder that `uritransform` is an option which requires a
trusted source, otherwise it is rejected.uritransform= with DNR syntax1 parent 25d9964 commit aaf35d9
File tree
5 files changed
+50
-26
lines changed- src/js
5 files changed
+50
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
| 186 | + | |
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1886 | 1886 | | |
1887 | 1887 | | |
1888 | 1888 | | |
1889 | | - | |
| 1889 | + | |
| 1890 | + | |
| 1891 | + | |
1890 | 1892 | | |
1891 | 1893 | | |
1892 | 1894 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
956 | 956 | | |
957 | 957 | | |
958 | 958 | | |
959 | | - | |
| 959 | + | |
960 | 960 | | |
961 | 961 | | |
962 | 962 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
841 | 841 | | |
842 | 842 | | |
843 | 843 | | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
844 | 849 | | |
845 | 850 | | |
846 | 851 | | |
| |||
1512 | 1517 | | |
1513 | 1518 | | |
1514 | 1519 | | |
1515 | | - | |
1516 | | - | |
1517 | | - | |
1518 | | - | |
1519 | | - | |
1520 | | - | |
| 1520 | + | |
1521 | 1521 | | |
1522 | 1522 | | |
1523 | 1523 | | |
| |||
3080 | 3080 | | |
3081 | 3081 | | |
3082 | 3082 | | |
3083 | | - | |
3084 | | - | |
3085 | | - | |
| 3083 | + | |
| 3084 | + | |
| 3085 | + | |
| 3086 | + | |
3086 | 3087 | | |
3087 | 3088 | | |
3088 | 3089 | | |
| |||
3092 | 3093 | | |
3093 | 3094 | | |
3094 | 3095 | | |
| 3096 | + | |
| 3097 | + | |
| 3098 | + | |
3095 | 3099 | | |
3096 | 3100 | | |
3097 | 3101 | | |
| |||
3101 | 3105 | | |
3102 | 3106 | | |
3103 | 3107 | | |
3104 | | - | |
| 3108 | + | |
| 3109 | + | |
| 3110 | + | |
| 3111 | + | |
3105 | 3112 | | |
3106 | 3113 | | |
3107 | 3114 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1231 | 1231 | | |
1232 | 1232 | | |
1233 | 1233 | | |
1234 | | - | |
1235 | 1234 | | |
1236 | 1235 | | |
1237 | 1236 | | |
| |||
4783 | 4782 | | |
4784 | 4783 | | |
4785 | 4784 | | |
4786 | | - | |
| 4785 | + | |
| 4786 | + | |
| 4787 | + | |
| 4788 | + | |
| 4789 | + | |
| 4790 | + | |
| 4791 | + | |
| 4792 | + | |
| 4793 | + | |
| 4794 | + | |
| 4795 | + | |
| 4796 | + | |
| 4797 | + | |
4787 | 4798 | | |
4788 | 4799 | | |
4789 | 4800 | | |
| |||
5500 | 5511 | | |
5501 | 5512 | | |
5502 | 5513 | | |
5503 | | - | |
| 5514 | + | |
5504 | 5515 | | |
5505 | 5516 | | |
5506 | 5517 | | |
| |||
5514 | 5525 | | |
5515 | 5526 | | |
5516 | 5527 | | |
5517 | | - | |
5518 | | - | |
5519 | | - | |
| 5528 | + | |
| 5529 | + | |
| 5530 | + | |
| 5531 | + | |
| 5532 | + | |
| 5533 | + | |
| 5534 | + | |
| 5535 | + | |
| 5536 | + | |
| 5537 | + | |
| 5538 | + | |
5520 | 5539 | | |
5521 | | - | |
5522 | | - | |
5523 | | - | |
5524 | | - | |
5525 | | - | |
5526 | | - | |
| 5540 | + | |
5527 | 5541 | | |
| 5542 | + | |
5528 | 5543 | | |
5529 | 5544 | | |
5530 | 5545 | | |
| |||
5724 | 5739 | | |
5725 | 5740 | | |
5726 | 5741 | | |
5727 | | - | |
| 5742 | + | |
5728 | 5743 | | |
5729 | 5744 | | |
5730 | 5745 | | |
| |||
0 commit comments