File tree 4 files changed +10
-10
lines changed
4 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -120,13 +120,13 @@ It is possible to apply custom rules to modify the response. This can be used to
120
120
See in [ ruleset.yaml] ( ruleset.yaml ) for an example.
121
121
122
122
``` yaml
123
- - domain : www. example.com
123
+ - domain : example.com # Inbcludes all subdomains
124
124
domains : # Additional domains to apply the rule
125
- - www.example.com
125
+ - www.example.de
126
126
- www.beispiel.de
127
127
headers :
128
128
x-forwarded-for : none # override X-Forwarded-For header or delete with none
129
- referer : none # override Referer header or delete with none
129
+ referer : none # override Referer header or delete with none
130
130
user-agent : Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36
131
131
cookie : privacy=1
132
132
regexRules :
Original file line number Diff line number Diff line change @@ -209,9 +209,11 @@ func fetchRule(domain string, path string) Rule {
209
209
rule := Rule {}
210
210
for _ , rule := range rulesSet {
211
211
domains := rule .Domains
212
- domains = append (domains , rule .Domain )
212
+ if rule .Domain != "" {
213
+ domains = append (domains , rule .Domain )
214
+ }
213
215
for _ , ruleDomain := range domains {
214
- if ruleDomain == domain {
216
+ if ruleDomain == domain || strings . HasSuffix ( domain , ruleDomain ) {
215
217
if len (rule .Paths ) > 0 && ! StringInSlice (path , rule .Paths ) {
216
218
continue
217
219
}
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ type Regex struct {
8
8
type RuleSet []Rule
9
9
10
10
type Rule struct {
11
- Domain string `yaml:"domain"`
11
+ Domain string `yaml:"domain,omitempty "`
12
12
Domains []string `yaml:"domains,omitempty"`
13
13
Paths []string `yaml:"paths,omitempty"`
14
14
Headers struct {
Original file line number Diff line number Diff line change 1
- - domain : www. example.com
1
+ - domain : example.com
2
2
domains :
3
3
- www.beispiel.de
4
4
googleCache : true
156
156
headimage.forEach(image => { image.style.filter = ''; });
157
157
});
158
158
</script>
159
- - domain : www.medium.com
160
- domains :
161
- - medium.com
159
+ - domain : medium.com
162
160
headers :
163
161
referer : https://t.co/x?amp=1
164
162
x-forwarded-for : none
You can’t perform that action at this time.
0 commit comments