diff --git a/pkg/middleware/middleware.go b/pkg/middleware/middleware.go index 1d512ac54..5ac47822c 100644 --- a/pkg/middleware/middleware.go +++ b/pkg/middleware/middleware.go @@ -569,7 +569,7 @@ func (s *SouinBaseHandler) ServeHTTP(rw http.ResponseWriter, rq *http.Request, n req := s.context.SetBaseContext(rq) cacheName := req.Context().Value(context.CacheName).(string) - if rq.Header.Get("Upgrade") == "websocket" || (s.ExcludeRegex != nil && s.ExcludeRegex.MatchString(rq.RequestURI)) { + if rq.Header.Get("Upgrade") == "websocket" || rq.Header.Get("Accept") == "text/event-stream" || (s.ExcludeRegex != nil && s.ExcludeRegex.MatchString(rq.RequestURI)) { rw.Header().Set("Cache-Status", cacheName+"; fwd=bypass; detail=EXCLUDED-REQUEST-URI") return next(rw, req) } diff --git a/plugins/go-zero/examples/internal/handler/routes.go b/plugins/go-zero/examples/internal/handler/routes.go index 664356b03..3bb44eec0 100644 --- a/plugins/go-zero/examples/internal/handler/routes.go +++ b/plugins/go-zero/examples/internal/handler/routes.go @@ -1,5 +1,5 @@ // Code generated by goctl. DO NOT EDIT. -// goctl 1.7.2 +// goctl 1.7.3 package handler diff --git a/plugins/traefik/vendor/github.com/darkweak/souin/configurationtypes/types.go b/plugins/traefik/vendor/github.com/darkweak/souin/configurationtypes/types.go index 684b56241..10729fea2 100644 --- a/plugins/traefik/vendor/github.com/darkweak/souin/configurationtypes/types.go +++ b/plugins/traefik/vendor/github.com/darkweak/souin/configurationtypes/types.go @@ -241,6 +241,7 @@ type DefaultCache struct { Redis CacheProvider `json:"redis" yaml:"redis"` Port Port `json:"port" yaml:"port"` Regex Regex `json:"regex" yaml:"regex"` + SimpleFS CacheProvider `json:"simplefs" yaml:"simplefs"` Stale Duration `json:"stale" yaml:"stale"` Storers []string `json:"storers" yaml:"storers"` Timeout Timeout `json:"timeout" yaml:"timeout"` @@ -295,7 +296,7 @@ func (d *DefaultCache) GetMode() string { return d.Mode } -// GetNats returns nuts configuration +// GetNats returns nats configuration func (d *DefaultCache) GetNats() CacheProvider { return d.Nats } @@ -325,6 +326,11 @@ func (d *DefaultCache) GetRegex() Regex { return d.Regex } +// GetSimpleFS returns simpleFS configuration +func (d *DefaultCache) GetSimpleFS() CacheProvider { + return d.SimpleFS +} + // GetTimeout returns the backend and cache timeouts func (d *DefaultCache) GetTimeout() Timeout { return d.Timeout @@ -376,6 +382,7 @@ type DefaultCacheInterface interface { GetHeaders() []string GetKey() Key GetRegex() Regex + GetSimpleFS() CacheProvider GetStale() time.Duration GetStorers() []string GetTimeout() Timeout