1
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-11-04 08:17:24 -05:00

Download files to their original filename (#1676)

This commit is contained in:
silverwind 2017-05-05 08:03:54 +02:00 committed by Lunny Xiao
parent 98460a8d9d
commit 935caa7f95

View File

@ -7,6 +7,7 @@ package repo
import (
"fmt"
"io"
"path"
"strings"
"code.gitea.io/git"
@ -24,6 +25,7 @@ func ServeData(ctx *context.Context, name string, reader io.Reader) error {
}
ctx.Resp.Header().Set("Cache-Control", "public,max-age=86400")
name = path.Base(name)
// Google Chrome dislike commas in filenames, so let's change it to a space
name = strings.Replace(name, ",", " ", -1)