Skip to content

Commit

Permalink
allow for appropriate content-type to be set (grafana#36545)
Browse files Browse the repository at this point in the history
  • Loading branch information
wbrowne authored Jul 8, 2021
1 parent 5c3c15f commit 2616580
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pkg/api/plugins.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2616580

Please sign in to comment.