aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/repo/download.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/web/repo/download.go')
-rw-r--r--routers/web/repo/download.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/routers/web/repo/download.go b/routers/web/repo/download.go
index cb1163c70b..020cebf196 100644
--- a/routers/web/repo/download.go
+++ b/routers/web/repo/download.go
@@ -46,7 +46,7 @@ func ServeBlobOrLFS(ctx *context.Context, blob *git.Blob, lastModified *time.Tim
log.Error("ServeBlobOrLFS: Close: %v", err)
}
closed = true
- return common.ServeBlob(ctx.Base, ctx.Repo.TreePath, blob, lastModified)
+ return common.ServeBlob(ctx.Base, ctx.Repo.Repository, ctx.Repo.TreePath, blob, lastModified)
}
if httpcache.HandleGenericETagCache(ctx.Req, ctx.Resp, `"`+pointer.Oid+`"`) {
return nil
@@ -78,14 +78,14 @@ func ServeBlobOrLFS(ctx *context.Context, blob *git.Blob, lastModified *time.Tim
}
closed = true
- return common.ServeBlob(ctx.Base, ctx.Repo.TreePath, blob, lastModified)
+ return common.ServeBlob(ctx.Base, ctx.Repo.Repository, ctx.Repo.TreePath, blob, lastModified)
}
func getBlobForEntry(ctx *context.Context) (*git.Blob, *time.Time) {
entry, err := ctx.Repo.Commit.GetTreeEntryByPath(ctx.Repo.TreePath)
if err != nil {
if git.IsErrNotExist(err) {
- ctx.NotFound("GetTreeEntryByPath", err)
+ ctx.NotFound(err)
} else {
ctx.ServerError("GetTreeEntryByPath", err)
}
@@ -93,7 +93,7 @@ func getBlobForEntry(ctx *context.Context) (*git.Blob, *time.Time) {
}
if entry.IsDir() || entry.IsSubModule() {
- ctx.NotFound("getBlobForEntry", nil)
+ ctx.NotFound(nil)
return nil, nil
}
@@ -114,7 +114,7 @@ func SingleDownload(ctx *context.Context) {
return
}
- if err := common.ServeBlob(ctx.Base, ctx.Repo.TreePath, blob, lastModified); err != nil {
+ if err := common.ServeBlob(ctx.Base, ctx.Repo.Repository, ctx.Repo.TreePath, blob, lastModified); err != nil {
ctx.ServerError("ServeBlob", err)
}
}
@@ -136,13 +136,13 @@ func DownloadByID(ctx *context.Context) {
blob, err := ctx.Repo.GitRepo.GetBlob(ctx.PathParam("sha"))
if err != nil {
if git.IsErrNotExist(err) {
- ctx.NotFound("GetBlob", nil)
+ ctx.NotFound(nil)
} else {
ctx.ServerError("GetBlob", err)
}
return
}
- if err = common.ServeBlob(ctx.Base, ctx.Repo.TreePath, blob, nil); err != nil {
+ if err = common.ServeBlob(ctx.Base, ctx.Repo.Repository, ctx.Repo.TreePath, blob, nil); err != nil {
ctx.ServerError("ServeBlob", err)
}
}
@@ -152,7 +152,7 @@ func DownloadByIDOrLFS(ctx *context.Context) {
blob, err := ctx.Repo.GitRepo.GetBlob(ctx.PathParam("sha"))
if err != nil {
if git.IsErrNotExist(err) {
- ctx.NotFound("GetBlob", nil)
+ ctx.NotFound(nil)
} else {
ctx.ServerError("GetBlob", err)
}