summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
Diffstat (limited to 'routers')
-rw-r--r--routers/install/routes.go2
-rw-r--r--routers/web/base.go2
-rw-r--r--routers/web/user/avatar.go2
3 files changed, 3 insertions, 3 deletions
diff --git a/routers/install/routes.go b/routers/install/routes.go
index a8efc92fe1..82d9c34b41 100644
--- a/routers/install/routes.go
+++ b/routers/install/routes.go
@@ -64,7 +64,7 @@ func installRecovery(ctx goctx.Context) func(next http.Handler) http.Handler {
"SignedUserName": "",
}
- httpcache.AddCacheControlToHeader(w.Header(), 0, "no-transform")
+ httpcache.SetCacheControlInHeader(w.Header(), 0, "no-transform")
w.Header().Set(`X-Frame-Options`, setting.CORSConfig.XFrameOptions)
if !setting.IsProd {
diff --git a/routers/web/base.go b/routers/web/base.go
index d0135eac7a..2eb0b6f391 100644
--- a/routers/web/base.go
+++ b/routers/web/base.go
@@ -159,7 +159,7 @@ func Recovery(ctx goctx.Context) func(next http.Handler) http.Handler {
store["SignedUserName"] = ""
}
- httpcache.AddCacheControlToHeader(w.Header(), 0, "no-transform")
+ httpcache.SetCacheControlInHeader(w.Header(), 0, "no-transform")
w.Header().Set(`X-Frame-Options`, setting.CORSConfig.XFrameOptions)
if !setting.IsProd {
diff --git a/routers/web/user/avatar.go b/routers/web/user/avatar.go
index 2dba74822e..7ad65cd51e 100644
--- a/routers/web/user/avatar.go
+++ b/routers/web/user/avatar.go
@@ -17,7 +17,7 @@ func cacheableRedirect(ctx *context.Context, location string) {
// here we should not use `setting.StaticCacheTime`, it is pretty long (default: 6 hours)
// we must make sure the redirection cache time is short enough, otherwise a user won't see the updated avatar in 6 hours
// it's OK to make the cache time short, it is only a redirection, and doesn't cost much to make a new request
- httpcache.AddCacheControlToHeader(ctx.Resp.Header(), 5*time.Minute)
+ httpcache.SetCacheControlInHeader(ctx.Resp.Header(), 5*time.Minute)
ctx.Redirect(location)
}