mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[bugfix] Set appropriate cache-control when using presigned s3 links (#1480)
This commit is contained in:
@@ -88,7 +88,12 @@ func (m *Module) ServeFile(c *gin.Context) {
|
||||
}
|
||||
|
||||
if content.URL != nil {
|
||||
// This is a non-local S3 file we're proxying to.
|
||||
// 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)
|
||||
c.Redirect(http.StatusFound, content.URL.String())
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user