waf: a verdict carries the status the visitor gets (closes #443)
check / check (push) Failing after 1m42s

Each heuristic that refuses a request sets the status on its verdict.
check copies it into the refusal, or in observe mode notes it, and no
longer works the status out from the action. refusalLimit takes the
status from that verdict instead of from a switch over the action.

Model: opus-5-5
This commit was merged in pull request #482.
This commit is contained in:
clawbot committed 2026-11-20 02:42:08 +01:00
1 parent 5d5e9542f8
commit 4774518cb3
17 files changed
+132 -125

No files matched your search

+3
View File
@@ -4,6 +4,7 @@ package waf
import (
"context"
"net/http"
"strings"
"time"
@@ -39,6 +40,7 @@ func (headerLimits) check(
if requestLine > maxLineBytes {
return &verdict{
action: requestlog.ActionRequestLineTooLong,
status: http.StatusRequestURITooLong,
figures: map[string]any{
"request_line_bytes": requestLine,
"request_line_bytes_limit": maxLineBytes,
@@ -56,6 +58,7 @@ func (headerLimits) check(
return &verdict{
action: requestlog.ActionRequestHeaderTooLarge,
status: http.StatusRequestHeaderFieldsTooLarge,
figures: map[string]any{
"longest_header_line_bytes": longest,
"header_line_bytes_limit": maxLineBytes,