mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-17 19:00:25 +08:00
区域封禁增加延时返回
This commit is contained in:
@@ -12,6 +12,7 @@ import (
|
|||||||
"github.com/iwind/TeaGo/types"
|
"github.com/iwind/TeaGo/types"
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
// 调用WAF
|
// 调用WAF
|
||||||
@@ -182,8 +183,8 @@ func (this *HTTPRequest) checkWAFRequest(firewallPolicy *firewallconfigs.HTTPFir
|
|||||||
this.writeCode(http.StatusForbidden, "The region has been denied.", "当前区域禁止访问")
|
this.writeCode(http.StatusForbidden, "The region has been denied.", "当前区域禁止访问")
|
||||||
}
|
}
|
||||||
|
|
||||||
this.writer.Flush()
|
// 延时返回,避免攻击
|
||||||
this.writer.Close()
|
time.Sleep(1 * time.Second)
|
||||||
|
|
||||||
// 停止日志
|
// 停止日志
|
||||||
if !logDenying {
|
if !logDenying {
|
||||||
@@ -209,8 +210,9 @@ func (this *HTTPRequest) checkWAFRequest(firewallPolicy *firewallconfigs.HTTPFir
|
|||||||
} else {
|
} else {
|
||||||
this.writeCode(http.StatusForbidden, "The region has been denied.", "当前区域禁止访问")
|
this.writeCode(http.StatusForbidden, "The region has been denied.", "当前区域禁止访问")
|
||||||
}
|
}
|
||||||
this.writer.Flush()
|
|
||||||
this.writer.Close()
|
// 延时返回,避免攻击
|
||||||
|
time.Sleep(1 * time.Second)
|
||||||
|
|
||||||
// 停止日志
|
// 停止日志
|
||||||
if !logDenying {
|
if !logDenying {
|
||||||
|
|||||||
Reference in New Issue
Block a user