1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-12-22 12:54:53 -05:00

add cache-control for attachments

This commit is contained in:
Unknwon 2015-08-12 04:58:39 +08:00
parent e67659bf8e
commit b410207dc1

View file

@ -345,6 +345,7 @@ func runWeb(ctx *cli.Context) {
}
defer fr.Close()
ctx.Header().Set("Cache-Control", "public,max-age=86400")
// Fix #312. Attachments with , in their name are not handled correctly by Google Chrome.
// We must put the name in " manually.
if err = repo.ServeData(ctx, "\""+attach.Name+"\"", fr); err != nil {