api: adds no-cache header for GET requests

Fixes #5356. Internet Explorer aggressively caches GET requests which
means that all API calls fetching data are cached. This fix adds a
Cache-Control header with the value no-cache to all GET requests to
the API.
This commit is contained in:
Daniel Lee
2017-07-04 16:33:37 +02:00
parent f773a9b4c3
commit 74093c700f
3 changed files with 21 additions and 0 deletions

View File

@@ -171,6 +171,8 @@ func (hs *HttpServer) newMacaron() *macaron.Macaron {
m.Use(middleware.ValidateHostHeader(setting.Domain))
}
m.Use(middleware.AddDefaultResponseHeaders())
return m
}