summaryrefslogtreecommitdiff
path: root/internal/api/fileserver
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2023-02-13 12:58:22 +0100
committerLibravatar GitHub <noreply@github.com>2023-02-13 12:58:22 +0100
commit041c8e695ec9246d6bb5436aa6e334c4ecda9ede (patch)
treed951e1756288fedc639c08357946ca8699b2795a /internal/api/fileserver
parent[docs] Update user/admin settings docs (#1491) (diff)
downloadgotosocial-041c8e695ec9246d6bb5436aa6e334c4ecda9ede.tar.xz
[chore] Do cache-control in a less silly way to avoid writing header twice (#1481)
* do cache-control in a less silly way to avoid writing header twice * add comment back in
Diffstat (limited to 'internal/api/fileserver')
-rw-r--r--internal/api/fileserver/servefile.go7
1 files changed, 1 insertions, 6 deletions
diff --git a/internal/api/fileserver/servefile.go b/internal/api/fileserver/servefile.go
index 6b125debc..df3c83fe7 100644
--- a/internal/api/fileserver/servefile.go
+++ b/internal/api/fileserver/servefile.go
@@ -88,12 +88,7 @@ func (m *Module) ServeFile(c *gin.Context) {
}
if content.URL != nil {
- // This is a non-local S3 file we're redirecting to.
- // Rewrite the cache control header to reflect the
- // TTL of the generated signed link, instead of the
- // default very long cache.
- const cacheControl = "private,max-age=86400" // 24h
- c.Header("Cache-Control", cacheControl)
+ // This is a non-local, non-proxied S3 file we're redirecting to.
c.Redirect(http.StatusFound, content.URL.String())
return
}