mirror of
https://github.com/go-gitea/gitea
synced 2025-08-10 03:28:20 +00:00
@@ -158,7 +158,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 {
|
||||
|
@@ -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)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user