mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-24 23:33:33 +01:00
wrong link should 404
This commit is contained in:
parent
7c6c6125f3
commit
b4a55434a4
1 changed files with 5 additions and 0 deletions
|
@ -87,6 +87,11 @@ func Single(ctx *middleware.Context, params martini.Params) {
|
|||
|
||||
branchLink := "/" + ctx.Repo.Owner.LowerName + "/" + ctx.Repo.Repository.Name + "/src/" + params["branchname"]
|
||||
|
||||
if len(treename) != 0 && repoFile == nil {
|
||||
ctx.Error(404)
|
||||
return
|
||||
}
|
||||
|
||||
if repoFile != nil && repoFile.IsFile() {
|
||||
if repoFile.Size > 1024*1024 || repoFile.Filemode != git.FileModeBlob {
|
||||
ctx.Data["FileIsLarge"] = true
|
||||
|
|
Loading…
Reference in a new issue