Skip to content

Commit e302b10

Browse files
committed
Fix bug in CheckRules()
1 parent 15631ad commit e302b10

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

service/proxy.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,13 +221,15 @@ func handleRequest(w http.ResponseWriter, r *http.Request) {
221221

222222
switch action.Type {
223223
case "", "Allow":
224-
w.WriteHeader(action.StatusCode)
224+
// Do not write header for Allow action, let the proxy handle it
225225
case "Block":
226226
responseError(w, "Blocked by CasWAF: %s", reason)
227227
w.WriteHeader(action.StatusCode)
228+
return
228229
case "Drop":
229230
responseError(w, "Dropped by CasWAF: %s", reason)
230231
w.WriteHeader(action.StatusCode)
232+
return
231233
case "CAPTCHA":
232234
ok := isVerifiedSession(r)
233235
if ok {

0 commit comments

Comments
 (0)