mirror of
https://github.com/TecharoHQ/anubis.git
synced 2026-04-17 22:04:56 +00:00
Add headers bot rule (#300)
* Closes #291: add headers support to bot policy rules * Fix config validator
This commit is contained in:
@@ -87,6 +87,18 @@ func TestBotValid(t *testing.T) {
|
||||
},
|
||||
err: ErrInvalidPathRegex,
|
||||
},
|
||||
{
|
||||
name: "invalid headers regex",
|
||||
bot: BotConfig{
|
||||
Name: "mozilla-ua",
|
||||
Action: RuleChallenge,
|
||||
HeadersRegex: map[string]string{
|
||||
"Content-Type": "a(b",
|
||||
},
|
||||
PathRegex: p("a(b"),
|
||||
},
|
||||
err: ErrInvalidHeadersRegex,
|
||||
},
|
||||
{
|
||||
name: "challenge difficulty too low",
|
||||
bot: BotConfig{
|
||||
|
||||
Reference in New Issue
Block a user