summaryrefslogtreecommitdiffstats
path: root/routers/repo/repo.go
diff options
context:
space:
mode:
authorLauris BH <lauris@nix.lv>2018-03-15 23:13:34 +0200
committerKim "BKC" Carlbäcker <kim.carlbacker@gmail.com>2018-03-15 22:13:34 +0100
commit7b2b900e13612f565051c64374b788b0c8a82751 (patch)
treed5d35b485ea898ea13fbf2eac9f879e311ef8ac8 /routers/repo/repo.go
parenta2a49c93c78a81d1eaa6b0eaf84a0c3f4bcd2487 (diff)
downloadgitea-7b2b900e13612f565051c64374b788b0c8a82751.tar.gz
gitea-7b2b900e13612f565051c64374b788b0c8a82751.zip
Refactor and simplify redirect to url (#3674)
Diffstat (limited to 'routers/repo/repo.go')
-rw-r--r--routers/repo/repo.go6
1 files changed, 1 insertions, 5 deletions
diff --git a/routers/repo/repo.go b/routers/repo/repo.go
index 20ea1e24a2..236d66bd1f 100644
--- a/routers/repo/repo.go
+++ b/routers/repo/repo.go
@@ -307,11 +307,7 @@ func Action(ctx *context.Context) {
return
}
- redirectTo := ctx.Query("redirect_to")
- if len(redirectTo) == 0 {
- redirectTo = ctx.Repo.RepoLink
- }
- ctx.Redirect(redirectTo)
+ ctx.RedirectToFirst(ctx.Query("redirect_to"), ctx.Repo.RepoLink)
}
// Download download an archive of a repository