Browse Source

Add Content-Disposition header for downloads (#3439)

tags/v1.21.12.1
Andrey Nering 无闻 9 years ago
parent
commit
fa12c282f6
1 changed files with 1 additions and 0 deletions
  1. +1
    -0
      cmd/web.go

+ 1
- 0
cmd/web.go View File

@@ -325,6 +325,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 {


Loading…
Cancel
Save