|
@@ -11,7 +11,7 @@ import (
|
|
|
"strings"
|
|
|
)
|
|
|
|
|
|
-//Zexpression is the set of regexp being used by zardoz
|
|
|
+//Zexpressions is the set of regexp being used by zardoz
|
|
|
var Zexpressions = []string{
|
|
|
`[[:alpha:]]{4,32}`, // alpha digit token
|
|
|
`[ ]([A-Za-z0-9-_]{4,}\.)+\w+`, // domain name
|
|
@@ -29,7 +29,7 @@ func passAndLearn(resp *http.Response) error {
|
|
|
switch {
|
|
|
case isAuth(resp):
|
|
|
log.Println("401: We don't want to store credentials")
|
|
|
- case IsError(resp):
|
|
|
+ case isError(resp):
|
|
|
buf := bytes.NewBufferString(BlockMessage)
|
|
|
resp.Body = ioutil.NopCloser(buf)
|
|
|
resp.Status = "403 Forbidden"
|
|
@@ -65,7 +65,7 @@ func blockAndlearn(resp *http.Response) error {
|
|
|
switch {
|
|
|
case isAuth(resp):
|
|
|
log.Println("401: We don't want to store credentials")
|
|
|
- case IsError(resp):
|
|
|
+ case isError(resp):
|
|
|
log.Println("Filing inside bad class")
|
|
|
feedRequest(req, "BAD")
|
|
|
case isSuccess(resp):
|
|
@@ -168,6 +168,6 @@ func isAuth(resp *http.Response) bool {
|
|
|
return resp.StatusCode == 401
|
|
|
}
|
|
|
|
|
|
-func IsError(resp *http.Response) bool {
|
|
|
+func isError(resp *http.Response) bool {
|
|
|
return resp.StatusCode >= 400 && resp.StatusCode != 401
|
|
|
}
|