mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-12-15 23:26:36 +08:00
WAF策略增加显示页面动作默认设置
This commit is contained in:
@@ -10,11 +10,21 @@ import (
|
||||
type PageAction struct {
|
||||
BaseAction
|
||||
|
||||
Status int `yaml:"status" json:"status"`
|
||||
Body string `yaml:"body" json:"body"`
|
||||
UseDefault bool `yaml:"useDefault" json:"useDefault"`
|
||||
Status int `yaml:"status" json:"status"`
|
||||
Body string `yaml:"body" json:"body"`
|
||||
}
|
||||
|
||||
func (this *PageAction) Init(waf *WAF) error {
|
||||
if waf.DefaultPageAction != nil {
|
||||
if this.Status <= 0 || this.UseDefault {
|
||||
this.Status = waf.DefaultPageAction.Status
|
||||
}
|
||||
if len(this.Body) == 0 || this.UseDefault {
|
||||
this.Body = waf.DefaultPageAction.Body
|
||||
}
|
||||
}
|
||||
|
||||
if this.Status <= 0 {
|
||||
this.Status = http.StatusForbidden
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user