Plugins: Fix Cache-Control header response for public/plugins/* assets API (#64051)

* fix caching

* fixeroo

* simplify

* undo changes

* fix test
This commit is contained in:
Will Browne
2023-03-06 12:42:18 -05:00
committed by GitHub
parent b9ebd5757a
commit 88666f9bbd
2 changed files with 54 additions and 1 deletions
+2 -1
View File
@@ -37,7 +37,8 @@ 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, "/api/datasources/proxy/") && !resourceCachable {
if !strings.HasPrefix(c.Req.URL.Path, "/public/plugins/") &&
!strings.HasPrefix(c.Req.URL.Path, "/api/datasources/proxy/") && !resourceCachable {
addNoCacheHeaders(c.Resp)
}