Merge: * filter: skip comment lines starting with '#'
* commit 'b034e25b26ec01c8b2607726646c55777ba66a1d': * filter: skip comment lines starting with '#'
This commit is contained in:
commit
6d136ee2cb
|
@ -478,6 +478,8 @@ func (f *Filtering) parseFilterContents(file io.Reader) (int, uint32, string) {
|
||||||
name = m[0][1]
|
name = m[0][1]
|
||||||
seenTitle = true
|
seenTitle = true
|
||||||
}
|
}
|
||||||
|
} else if line[0] == '#' {
|
||||||
|
continue
|
||||||
} else {
|
} else {
|
||||||
rulesCount++
|
rulesCount++
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@ import (
|
||||||
func testStartFilterListener() net.Listener {
|
func testStartFilterListener() net.Listener {
|
||||||
http.HandleFunc("/filters/1.txt", func(w http.ResponseWriter, r *http.Request) {
|
http.HandleFunc("/filters/1.txt", func(w http.ResponseWriter, r *http.Request) {
|
||||||
content := `||example.org^$third-party
|
content := `||example.org^$third-party
|
||||||
|
# Inline comment example
|
||||||
||example.com^$third-party
|
||example.com^$third-party
|
||||||
0.0.0.0 example.com
|
0.0.0.0 example.com
|
||||||
`
|
`
|
||||||
|
|
Loading…
Reference in New Issue