修复WAF OnAction在并发时无法准确调用请求动作的Bug

This commit is contained in:
GoEdgeLab
2021-12-01 17:43:08 +08:00
parent 0b3ef14640
commit 28958b379d
8 changed files with 34 additions and 43 deletions

View File

@@ -38,10 +38,6 @@ func TestWAF_MatchRequest(t *testing.T) {
t.Fatal(err)
}
waf.OnAction(func(action ActionInterface) (goNext bool) {
return action.Code() != ActionBlock
})
req, err := http.NewRequest(http.MethodGet, "http://teaos.cn/hello?name=lu&age=20", nil)
if err != nil {
t.Fatal(err)