add cache-control for attachments

tokarchuk/v1.17
Unknwon 9 years ago
parent e67659bf8e
commit b410207dc1
  1. 1
      cmd/web.go

@ -345,6 +345,7 @@ func runWeb(ctx *cli.Context) {
} }
defer fr.Close() 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. // Fix #312. Attachments with , in their name are not handled correctly by Google Chrome.
// We must put the name in " manually. // We must put the name in " manually.
if err = repo.ServeData(ctx, "\""+attach.Name+"\"", fr); err != nil { if err = repo.ServeData(ctx, "\""+attach.Name+"\"", fr); err != nil {

Loading…
Cancel
Save