summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-08-12 04:58:39 +0800
committerUnknwon <u@gogs.io>2015-08-12 04:58:39 +0800
commitb410207dc1f624f9c14a90de97b22634667d762e (patch)
tree5851099b20624a3a7c36af28581bfb5ef4a60c00 /cmd
parente67659bf8e76763bdfdfe02d87359255b7acd19b (diff)
downloadgitea-b410207dc1f624f9c14a90de97b22634667d762e.tar.gz
gitea-b410207dc1f624f9c14a90de97b22634667d762e.zip
add cache-control for attachments
Diffstat (limited to 'cmd')
-rw-r--r--cmd/web.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/cmd/web.go b/cmd/web.go
index 6ca771e230..62fb9187ab 100644
--- a/cmd/web.go
+++ b/cmd/web.go
@@ -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 {