mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-09-08 00:03:28 +00:00
#2842 add quotes to attachment file name
This commit is contained in:
parent
b1d41cfa60
commit
dd36c431ec
1 changed files with 1 additions and 1 deletions
|
@ -25,7 +25,7 @@ func ServeData(ctx *context.Context, name string, reader io.Reader) error {
|
||||||
if !isTextFile {
|
if !isTextFile {
|
||||||
_, isImageFile := base.IsImageFile(buf)
|
_, isImageFile := base.IsImageFile(buf)
|
||||||
if !isImageFile {
|
if !isImageFile {
|
||||||
ctx.Resp.Header().Set("Content-Disposition", "attachment; filename="+path.Base(ctx.Repo.TreeName))
|
ctx.Resp.Header().Set("Content-Disposition", "attachment; filename=\""+path.Base(ctx.Repo.TreeName)+"\"")
|
||||||
ctx.Resp.Header().Set("Content-Transfer-Encoding", "binary")
|
ctx.Resp.Header().Set("Content-Transfer-Encoding", "binary")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue