mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-30 04:02:25 -05:00
[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
This commit is contained in:
parent
eeca1988ce
commit
041c8e695e
2 changed files with 22 additions and 16 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue