Avatar: Allow browser caching of /avatar/ (#78314)

don't set no-store headers to /avatar/
This commit is contained in:
Oscar Kilhed 2023-11-22 17:41:54 +01:00 committed by GitHub
parent 4247696402
commit 4c4f11f4b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,6 +48,7 @@ func AddDefaultResponseHeaders(cfg *setting.Cfg) web.Handler {
_, _, resourceURLMatch := t.Match(c.Req.URL.Path)
resourceCachable := resourceURLMatch && allowCacheControl(c.Resp)
if !strings.HasPrefix(c.Req.URL.Path, "/public/plugins/") &&
!strings.HasPrefix(c.Req.URL.Path, "/avatar/") &&
!strings.HasPrefix(c.Req.URL.Path, "/api/datasources/proxy/") && !resourceCachable {
addNoCacheHeaders(c.Resp)
}