aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslene <vslene@gmail.com>2014-03-20 21:43:54 +0800
committerslene <vslene@gmail.com>2014-03-20 21:43:54 +0800
commitb4a55434a46ffaf5c18df10d6bb39eb1e775822b (patch)
tree89e9e99327ffbcee5b9f0101d92a96cb7055a648
parent7c6c6125f3846acc633c00bb92c8698c30e761fa (diff)
downloadgitea-b4a55434a46ffaf5c18df10d6bb39eb1e775822b.tar.gz
gitea-b4a55434a46ffaf5c18df10d6bb39eb1e775822b.zip
wrong link should 404
-rw-r--r--routers/repo/single.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/routers/repo/single.go b/routers/repo/single.go
index e218bc9158..f1b15cceed 100644
--- a/routers/repo/single.go
+++ b/routers/repo/single.go
@@ -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