mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-06-18 02:38:26 +08:00
wrong link should 404
This commit is contained in:
@ -87,6 +87,11 @@ func Single(ctx *middleware.Context, params martini.Params) {
|
|||||||
|
|
||||||
branchLink := "/" + ctx.Repo.Owner.LowerName + "/" + ctx.Repo.Repository.Name + "/src/" + params["branchname"]
|
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 != nil && repoFile.IsFile() {
|
||||||
if repoFile.Size > 1024*1024 || repoFile.Filemode != git.FileModeBlob {
|
if repoFile.Size > 1024*1024 || repoFile.Filemode != git.FileModeBlob {
|
||||||
ctx.Data["FileIsLarge"] = true
|
ctx.Data["FileIsLarge"] = true
|
||||||
|
Reference in New Issue
Block a user