From 4c16d55e116673690bd7364b5bed5db173b5d865 Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Thu, 8 Jul 2021 11:35:42 +0200 Subject: [PATCH] allow for appropriate content-type to be set (#36545) (#36550) (cherry picked from commit 2616580bae3218c91b38a93ae2fc74ba3276462f) Co-authored-by: Will Browne --- pkg/api/plugins.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkg/api/plugins.go b/pkg/api/plugins.go index d98c4fbd809..f63ff573ac2 100644 --- a/pkg/api/plugins.go +++ b/pkg/api/plugins.go @@ -294,14 +294,12 @@ func (hs *HTTPServer) GetPluginAssets(c *models.ReqContext) response.Response { } resp := response.CreateNormalResponse( - http.Header{"Content-Type": []string{"text/plain", "charset=utf-8"}}, + http.Header{"Cache-Control": []string{"public", "max-age=3600"}}, []byte{}, 200) if hs.Cfg.Env == setting.Dev { resp.SetHeader("Cache-Control", "max-age=0, must-revalidate, no-cache") - } else { - resp.SetHeader("Cache-Control", "public, max-age=3600") } http.ServeContent(resp, c.Req.Request, pluginFilePath, fi.ModTime(), f)