Skip to content

Commit

Permalink
feat: rename Captcha to CAPTCHA (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
love98ooo authored Sep 23, 2024
1 parent 855e225 commit 3a211f2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions rule/rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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())
Expand Down
2 changes: 1 addition & 1 deletion service/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3a211f2

Please sign in to comment.