Skip to content

Commit

Permalink
Fix notext
Browse files Browse the repository at this point in the history
  • Loading branch information
nates committed Oct 11, 2020
1 parent c1acf87 commit 5a8d4e4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/checker/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ func check(ip string, port string, proxyType string, proxyTimeout *int, proxyUrl
if err != nil {
return 0, errors.New("Error reading body.")
}
if notext != "" {
if strings.Contains(string(body), notext) {
return 0, errors.New("Invalid proxy.")
}
}
if !strings.Contains(string(body), text) {
return 0, errors.New("Invalid proxy.")
}
Expand All @@ -63,6 +68,11 @@ func check(ip string, port string, proxyType string, proxyTimeout *int, proxyUrl
if err != nil {
return 0, errors.New("Error reading body.")
}
if notext != "" {
if strings.Contains(string(body), notext) {
return 0, errors.New("Invalid proxy.")
}
}
if !strings.Contains(string(body), text) {
return 0, errors.New("Invalid proxy.")
}
Expand Down

0 comments on commit 5a8d4e4

Please sign in to comment.