WAF多个相同Key的cc2统计规则不再重复累加

This commit is contained in:
刘祥超
2022-07-25 09:34:34 +08:00
parent 04ebfbea8a
commit 73888c98a8
57 changed files with 189 additions and 179 deletions

View File

@@ -23,21 +23,21 @@ func TestCCCheckpoint_RequestValue(t *testing.T) {
options := maps.Map{
"period": "5",
}
t.Log(checkpoint.RequestValue(req, "requests", options))
t.Log(checkpoint.RequestValue(req, "requests", options))
t.Log(checkpoint.RequestValue(req, "requests", options, 1))
t.Log(checkpoint.RequestValue(req, "requests", options, 1))
req.WAFRaw().RemoteAddr = "127.0.0.2"
t.Log(checkpoint.RequestValue(req, "requests", options))
t.Log(checkpoint.RequestValue(req, "requests", options, 1))
req.WAFRaw().RemoteAddr = "127.0.0.1"
t.Log(checkpoint.RequestValue(req, "requests", options))
t.Log(checkpoint.RequestValue(req, "requests", options, 1))
req.WAFRaw().RemoteAddr = "127.0.0.2"
t.Log(checkpoint.RequestValue(req, "requests", options))
t.Log(checkpoint.RequestValue(req, "requests", options, 1))
req.WAFRaw().RemoteAddr = "127.0.0.2"
t.Log(checkpoint.RequestValue(req, "requests", options))
t.Log(checkpoint.RequestValue(req, "requests", options, 1))
req.WAFRaw().RemoteAddr = "127.0.0.2"
t.Log(checkpoint.RequestValue(req, "requests", options))
t.Log(checkpoint.RequestValue(req, "requests", options, 1))
}