diff options
author | Andrey Nering <andrey.nering@gmail.com> | 2016-11-27 08:48:26 -0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-27 08:48:26 -0200 |
commit | c664ffd1db21c0376719266d594b4dab1df8dee1 (patch) | |
tree | 0b2cc88b8ac0c7ec9acbf52d879849730801868a /cmd | |
parent | 94da47271701401b6959bfd308d6c74fd30b22e2 (diff) | |
parent | d647d02c2f9816effd50b2eea45aa65fb1b4047c (diff) | |
download | gitea-c664ffd1db21c0376719266d594b4dab1df8dee1.tar.gz gitea-c664ffd1db21c0376719266d594b4dab1df8dee1.zip |
Merge pull request #270 from andreynering/gitea/http-headers-download
Fix HTTP headers for issue attachment download
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/web.go | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/cmd/web.go b/cmd/web.go index 3bb5ef3a9c..a962f9ca5a 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -336,11 +336,7 @@ func runWeb(ctx *cli.Context) error { } defer fr.Close() - ctx.Header().Set("Cache-Control", "public,max-age=86400") - ctx.Header().Set("Content-Disposition", fmt.Sprintf(`inline; filename="%s"`, attach.Name)) - // 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 { + if err = repo.ServeData(ctx, attach.Name, fr); err != nil { ctx.Handle(500, "ServeData", err) return } |