mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2026-04-29 18:55:18 +08:00
实现UA名单功能
This commit is contained in:
@@ -29,6 +29,7 @@ type HTTPWebConfig struct {
|
||||
RewriteRules []*HTTPRewriteRule `yaml:"rewriteRules" json:"rewriteRules"` // 重写规则
|
||||
FastcgiRef *HTTPFastcgiRef `yaml:"fastcgiRef" json:"fastcgiRef"` // Fastcgi引用
|
||||
FastcgiList []*HTTPFastcgiConfig `yaml:"fastcgiList" json:"fastcgiList"` // Fastcgi配置
|
||||
UserAgent *UserAgentConfig `yaml:"userAgent" json:"userAgent"` // UserAgent配置
|
||||
|
||||
RequestHeaderPolicyRef *shared.HTTPHeaderPolicyRef `yaml:"requestHeaderPolicyRef" json:"requestHeaderPolicyRef"` // 请求Header
|
||||
RequestHeaderPolicy *shared.HTTPHeaderPolicy `yaml:"requestHeaderPolicy" json:"requestHeaderPolicy"` // 请求Header策略
|
||||
@@ -283,6 +284,14 @@ func (this *HTTPWebConfig) Init() error {
|
||||
}
|
||||
}
|
||||
|
||||
// user agent
|
||||
if this.UserAgent != nil {
|
||||
err := this.UserAgent.Init()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user