mirror of https://github.com/gogs/gogs.git
Verify repository is not bare before retrieving blob. (#3996)
parent
8bcc0e392e
commit
740192564b
routers/api/v1/repo
|
@ -19,6 +19,11 @@ func GetRawFile(ctx *context.APIContext) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ctx.Repo.Repository.IsBare {
|
||||||
|
ctx.Status(404)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
blob, err := ctx.Repo.Commit.GetBlobByPath(ctx.Repo.TreePath)
|
blob, err := ctx.Repo.Commit.GetBlobByPath(ctx.Repo.TreePath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if git.IsErrNotExist(err) {
|
if git.IsErrNotExist(err) {
|
||||||
|
|
Loading…
Reference in New Issue