feat(botfilter): add TestEncodedScanPathBansBeforeUpstream
This commit is contained in:
1 parent
2b694690d9
commit
d8ab36da4a
1 file changed
+13
@@ -69,3 +69,16 @@ func TestWhitelistBypassesFilter(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestEncodedScanPathBansBeforeUpstream(t *testing.T) {
|
||||
cfg := CreateConfig()
|
||||
cfg.RequireUserAgent = false
|
||||
cfg.RequireAccept = false
|
||||
nextCalls := 0
|
||||
handler, err := New(context.Background(), http.HandlerFunc(func(rw http.ResponseWriter, _ *http.Request) {
|
||||
nextCalls++
|
||||
rw.WriteHeader(http.StatusOK)
|
||||
}), cfg, "test")
|
||||
if err != nil {
|
||||
t.Fatalf("New() error = %v", err)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user