mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Merge pull request #270 from andreynering/gitea/http-headers-download
Fix HTTP headers for issue attachment download
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user