aboutsummaryrefslogtreecommitdiffstats
path: root/routers/repo/download.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2016-08-24 21:35:03 -0700
committerUnknwon <u@gogs.io>2016-08-24 21:35:03 -0700
commitf8a48ffaad481ee9eaa8a42e0e7d64c12c90ef86 (patch)
tree21ee3e7965c77c16fcdaa209f01cebae6a809625 /routers/repo/download.go
parent67fb0fe6a5783f772abfb5438a154435dafff4de (diff)
downloadgitea-f8a48ffaad481ee9eaa8a42e0e7d64c12c90ef86.tar.gz
gitea-f8a48ffaad481ee9eaa8a42e0e7d64c12c90ef86.zip
Web editor: improve code quality
Diffstat (limited to 'routers/repo/download.go')
-rw-r--r--routers/repo/download.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/routers/repo/download.go b/routers/repo/download.go
index e9468aa06d..85aa76472b 100644
--- a/routers/repo/download.go
+++ b/routers/repo/download.go
@@ -25,7 +25,7 @@ func ServeData(ctx *context.Context, name string, reader io.Reader) error {
if !isTextFile {
_, isImageFile := base.IsImageFile(buf)
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.TreePath)+"\"")
ctx.Resp.Header().Set("Content-Transfer-Encoding", "binary")
}
} else if !ctx.QueryBool("render") {
@@ -42,11 +42,11 @@ func ServeBlob(ctx *context.Context, blob *git.Blob) error {
return err
}
- return ServeData(ctx, ctx.Repo.TreeName, dataRc)
+ return ServeData(ctx, ctx.Repo.TreePath, dataRc)
}
func SingleDownload(ctx *context.Context) {
- blob, err := ctx.Repo.Commit.GetBlobByPath(ctx.Repo.TreeName)
+ blob, err := ctx.Repo.Commit.GetBlobByPath(ctx.Repo.TreePath)
if err != nil {
if git.IsErrNotExist(err) {
ctx.Handle(404, "GetBlobByPath", nil)