mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-12-15 15:16:35 +08:00
优化代码
This commit is contained in:
@@ -64,7 +64,6 @@ func (this *BlockAction) Perform(waf *WAF, group *RuleGroup, set *RuleSet, reque
|
||||
timeout = 60 // 默认封锁60秒
|
||||
}
|
||||
|
||||
|
||||
SharedIPBlackList.RecordIP(IPTypeAll, this.Scope, request.WAFServerId(), request.WAFRemoteIP(), time.Now().Unix()+int64(timeout), waf.Id, group.Id, set.Id)
|
||||
|
||||
if writer != nil {
|
||||
@@ -99,8 +98,9 @@ func (this *BlockAction) Perform(waf *WAF, group *RuleGroup, set *RuleSet, reque
|
||||
}
|
||||
}
|
||||
|
||||
buf := make([]byte, 1024)
|
||||
buf := utils.BytePool1k.Get()
|
||||
_, _ = io.CopyBuffer(writer, resp.Body, buf)
|
||||
utils.BytePool1k.Put(buf)
|
||||
} else {
|
||||
path := this.URL
|
||||
if !filepath.IsAbs(this.URL) {
|
||||
|
||||
Reference in New Issue
Block a user