TagList, MaskZoneKey, ParseNetblock, ParseASN and ParsePercent move from config to reputation; config imports them from there. rules and config check header names with httpguts.ValidHeaderFieldName, and IsHeaderName goes. A new test pins that check to the characters IsHeaderName took, for the empty name and every single-byte name. Model: opus-5-5
This commit is contained in:
1 parent
967ccdf75e
commit
6efac940db
9 files changed
+209
-170
No files matched your search
@@ -21,9 +21,9 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/fsnotify/fsnotify"
|
||||
"golang.org/x/net/http/httpguts"
|
||||
|
||||
"sneak.berlin/go/smallwebwaf/internal/alerts"
|
||||
"sneak.berlin/go/smallwebwaf/internal/config"
|
||||
)
|
||||
|
||||
// The actions a rule takes when it matches.
|
||||
@@ -378,7 +378,7 @@ func parse(line string) (Rule, bool, error) {
|
||||
rule.Target,
|
||||
errNotTarget,
|
||||
)
|
||||
case isHeader && !config.IsHeaderName(headerName):
|
||||
case isHeader && !httpguts.ValidHeaderFieldName(headerName):
|
||||
return Rule{}, false, fmt.Errorf(
|
||||
"the target %q %w",
|
||||
rule.Target,
|
||||
|
||||
Reference in new issue
Block a user