From 5edf0e5b9e48553bc934c823ee07b6412d05dec2 Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Sat, 3 Sep 2022 18:15:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=AE=80=E5=8C=96=E7=9A=84?= =?UTF-8?q?=E7=BC=93=E5=AD=98=E6=9D=A1=E4=BB=B6=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/serverconfigs/http_cache_ref.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkg/serverconfigs/http_cache_ref.go b/pkg/serverconfigs/http_cache_ref.go index e76409a..d8523c0 100644 --- a/pkg/serverconfigs/http_cache_ref.go +++ b/pkg/serverconfigs/http_cache_ref.go @@ -29,7 +29,8 @@ type HTTPCacheRef struct { EnableIfNoneMatch bool `yaml:"enableIfNoneMatch" json:"enableIfNoneMatch"` EnableIfModifiedSince bool `yaml:"enableIfModifiedSince" json:"enableIfModifiedSince"` - Conds *shared.HTTPRequestCondsConfig `yaml:"conds" json:"conds"` // 请求条件 + Conds *shared.HTTPRequestCondsConfig `yaml:"conds" json:"conds"` // 复杂请求条件组合 + SimpleCond *shared.HTTPRequestCond `yaml:"simpleCond" json:"simpleCond"` // 简单条件 CachePolicy *HTTPCachePolicy `yaml:"cachePolicy" json:"cachePolicy"` @@ -69,6 +70,13 @@ func (this *HTTPCacheRef) Init() error { } } + if this.SimpleCond != nil { + err := this.SimpleCond.Init() + if err != nil { + return err + } + } + // policy if this.CachePolicy != nil { err := this.CachePolicy.Init()