aboutsummaryrefslogtreecommitdiffstats
path: root/services/context/api.go
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2025-03-13 07:04:50 +0800
committerGitHub <noreply@github.com>2025-03-13 07:04:50 +0800
commit3996518ed432218d7f2fd62d451ee0e29953d853 (patch)
tree9a3ef66b10e40eeee72c7a63b57f6153eee8a0ac /services/context/api.go
parent91610a987e4c805a9305d4ee951963f80dbeb9ee (diff)
downloadgitea-3996518ed432218d7f2fd62d451ee0e29953d853.tar.gz
gitea-3996518ed432218d7f2fd62d451ee0e29953d853.zip
Refactor cache-control (#33861)
And fix #21391
Diffstat (limited to 'services/context/api.go')
-rw-r--r--services/context/api.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/services/context/api.go b/services/context/api.go
index c163de036c..89280cac80 100644
--- a/services/context/api.go
+++ b/services/context/api.go
@@ -232,7 +232,7 @@ func APIContexter() func(http.Handler) http.Handler {
}
}
- httpcache.SetCacheControlInHeader(ctx.Resp.Header(), 0, "no-transform")
+ httpcache.SetCacheControlInHeader(ctx.Resp.Header(), &httpcache.CacheControlOptions{NoTransform: true})
ctx.Resp.Header().Set(`X-Frame-Options`, setting.CORSConfig.XFrameOptions)
next.ServeHTTP(ctx.Resp, ctx.Req)