mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-10 04:20:27 +08:00
实现WAF
This commit is contained in:
@@ -96,7 +96,11 @@ func (this *HTTPRequest) Do() {
|
||||
}
|
||||
|
||||
// WAF
|
||||
// TODO 需要实现
|
||||
if this.web.FirewallRef != nil && this.web.FirewallRef.IsOn && this.web.FirewallPolicy != nil && this.web.FirewallPolicy.IsOn {
|
||||
if this.doWAFRequest() {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// 访问控制
|
||||
// TODO 需要实现
|
||||
@@ -253,6 +257,12 @@ func (this *HTTPRequest) configureWeb(web *serverconfigs.HTTPWebConfig, isTop bo
|
||||
this.web.Cache = web.Cache
|
||||
}
|
||||
|
||||
// waf
|
||||
if web.FirewallRef != nil && (web.FirewallRef.IsPrior || isTop) {
|
||||
this.web.FirewallRef = web.FirewallRef
|
||||
this.web.FirewallPolicy = web.FirewallPolicy
|
||||
}
|
||||
|
||||
// 重写规则
|
||||
if len(web.RewriteRefs) > 0 {
|
||||
for index, ref := range web.RewriteRefs {
|
||||
|
||||
Reference in New Issue
Block a user