Skip to content

Commit

Permalink
Fix the domain matching method of the mix-list matcher. (#246)
Browse files Browse the repository at this point in the history
  • Loading branch information
LEXUGE authored Oct 30, 2020
1 parent 29cd667 commit 5912121
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions core/matcher/mix/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,12 @@ func (s *List) Has(str string) bool {
switch data.Type {
case "domain":
idx := len(str) - len(data.Content)
if idx > 0 && data.Content == str[idx:] {
return true
}
if idx >= 0 && data.Content == str[idx:] {
if idx >=1 && (str[idx-1] != '.') {
return false
}
return true
}
case "regex":
reg := regexp.MustCompile(data.Content)
if reg.MatchString(str) {
Expand Down

0 comments on commit 5912121

Please sign in to comment.