summaryrefslogtreecommitdiff
path: root/internal/api/fileserver
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2023-07-13 21:27:25 +0200
committerLibravatar GitHub <noreply@github.com>2023-07-13 21:27:25 +0200
commit12b6cdcd8ce52269be5a1ca8acaae006896808b5 (patch)
treeeba84aa522ba2ccbfb539930789a046630d03dae /internal/api/fileserver
parent[chore] Skip webfinger test on CI (#1983) (diff)
downloadgotosocial-12b6cdcd8ce52269be5a1ca8acaae006896808b5.tar.xz
[bugfix] Set Vary header correctly on cache-control (#1988)v0.10.0-rc2
* [bugfix] Set Vary header correctly on cache-control * Prefer activitypub types on AP endpoints * use immutable on file server, vary by range * vary auth on Accept
Diffstat (limited to 'internal/api/fileserver')
-rw-r--r--internal/api/fileserver/servefile.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/api/fileserver/servefile.go b/internal/api/fileserver/servefile.go
index 25a414319..12d24ca76 100644
--- a/internal/api/fileserver/servefile.go
+++ b/internal/api/fileserver/servefile.go
@@ -95,7 +95,7 @@ func (m *Module) ServeFile(c *gin.Context) {
// Derive the max-age value from how long the link has left until
// it expires.
maxAge := int(time.Until(content.URL.Expiry).Seconds())
- c.Header("Cache-Control", "private,max-age="+strconv.Itoa(maxAge))
+ c.Header("Cache-Control", "private, max-age="+strconv.Itoa(maxAge)+", immutable")
c.Redirect(http.StatusFound, content.URL.String())
return
}