在对IP封禁时,不写入访问日志

This commit is contained in:
刘祥超
2020-11-09 11:02:29 +08:00
parent 5682c9ba3e
commit 1a6b05f81b
3 changed files with 18 additions and 0 deletions

View File

@@ -34,6 +34,9 @@ func (this *HTTPRequest) doWAFRequest() (blocked bool) {
this.writer.WriteHeader(http.StatusForbidden)
this.writer.Close()
// 停止日志
this.disableLog = true
return true
}
}
@@ -54,6 +57,10 @@ func (this *HTTPRequest) doWAFRequest() (blocked bool) {
// TODO 可以配置对封禁的处理方式等
this.writer.WriteHeader(http.StatusForbidden)
this.writer.Close()
// 停止日志
this.disableLog = true
return true
}
}
@@ -65,6 +72,10 @@ func (this *HTTPRequest) doWAFRequest() (blocked bool) {
// TODO 可以配置对封禁的处理方式等
this.writer.WriteHeader(http.StatusForbidden)
this.writer.Close()
// 停止日志
this.disableLog = true
return true
}
}
@@ -73,6 +84,7 @@ func (this *HTTPRequest) doWAFRequest() (blocked bool) {
}
}
// 规则测试
w := sharedWAFManager.FindWAF(this.web.FirewallPolicy.Id)
if w == nil {
return