mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-10 12:30:25 +08:00
增加CC防护(开源用户需要自己实现)
This commit is contained in:
@@ -221,6 +221,18 @@ func (this *HTTPRequest) Do() {
|
||||
}
|
||||
}
|
||||
|
||||
// CC
|
||||
if !isHealthCheck {
|
||||
if this.web.CC != nil {
|
||||
if this.web.CC.IsOn {
|
||||
if this.doCC() {
|
||||
this.doEnd()
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// WAF
|
||||
if this.web.FirewallRef != nil && this.web.FirewallRef.IsOn {
|
||||
if this.doWAFRequest() {
|
||||
@@ -572,6 +584,11 @@ func (this *HTTPRequest) configureWeb(web *serverconfigs.HTTPWebConfig, isTop bo
|
||||
this.web.UAM = web.UAM
|
||||
}
|
||||
|
||||
// CC
|
||||
if web.CC != nil && (web.CC.IsPrior || isTop) {
|
||||
this.web.CC = web.CC
|
||||
}
|
||||
|
||||
// 重写规则
|
||||
if len(web.RewriteRefs) > 0 {
|
||||
for index, ref := range web.RewriteRefs {
|
||||
|
||||
Reference in New Issue
Block a user