Skip to content

Commit

Permalink
Merge commit '5a49db3701e9fa7e0e647a38bcdc9fc24ed0ce40'
Browse files Browse the repository at this point in the history
* commit '5a49db3701e9fa7e0e647a38bcdc9fc24ed0ce40':
  Adds a Cache-Control header to stop sensitive data from being cached (decred#319)
  • Loading branch information
girino committed Sep 7, 2019
2 parents 15069d7 + 5a49db3 commit 84333ff
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions system/core.go
Expand Up @@ -139,6 +139,9 @@ func (application *Application) Route(controller interface{}, route string) web.

switch code {
case http.StatusOK, http.StatusProcessing, http.StatusServiceUnavailable:
if r.URL.Path != "/" && r.URL.Path != "/stats" {
w.Header().Set("Cache-Control", "private,no-store,no-cache")
}
if _, exists := c.Env["Content-Type"]; exists {
w.Header().Set("Content-Type", c.Env["Content-Type"].(string))
}
Expand Down

0 comments on commit 84333ff

Please sign in to comment.