diff --git a/rule/rule.go b/rule/rule.go index 58f942c..f7ccab7 100644 --- a/rule/rule.go +++ b/rule/rule.go @@ -71,8 +71,8 @@ func CheckRules(ruleIds []string, r *http.Request) (*object.Action, string, erro case "Allow": actionObj.Type = "Allow" actionObj.StatusCode = 200 - case "Captcha": - actionObj.Type = "Captcha" + case "CAPTCHA": + actionObj.Type = "CAPTCHA" actionObj.StatusCode = 302 default: return nil, "", fmt.Errorf("unknown rule action: %s for rule: %s", action, rule.GetId()) @@ -88,7 +88,7 @@ func CheckRules(ruleIds []string, r *http.Request) (*object.Action, string, erro return actionObj, reason, nil } else if action == "Allow" { return actionObj, reason, nil - } else if action == "Captcha" { + } else if action == "CAPTCHA" { return actionObj, reason, nil } else { return nil, "", fmt.Errorf("unknown rule action: %s for rule: %s", action, rule.GetId()) diff --git a/service/proxy.go b/service/proxy.go index 9556438..24c074a 100644 --- a/service/proxy.go +++ b/service/proxy.go @@ -214,7 +214,7 @@ func handleRequest(w http.ResponseWriter, r *http.Request) { case "Drop": responseError(w, "Dropped by CasWAF: %s", reason) w.WriteHeader(action.StatusCode) - case "Captcha": + case "CAPTCHA": ok := isVerifiedSession(r) if ok { w.WriteHeader(http.StatusOK)