From bf552761894dee08f734d91f5c8175cd0cb2f9f5 Mon Sep 17 00:00:00 2001 From: SagePtr Date: Fri, 7 Sep 2018 03:37:02 +0200 Subject: Fix redirect with non-ascii branch names (#4764) (#4810) * Fix redirect with non-ascii branch names (#4764) * Add integration tests for non-ascii branch redirect * Fix mysql test and coverage test --- modules/context/repo.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/context/repo.go b/modules/context/repo.go index 17a319ecc0..7221ad7c8a 100644 --- a/modules/context/repo.go +++ b/modules/context/repo.go @@ -625,7 +625,7 @@ func RepoRefByType(refType RepoRefType) macaron.Handler { // redirect from old URL scheme to new URL scheme ctx.Redirect(path.Join( setting.AppSubURL, - strings.TrimSuffix(ctx.Req.URL.String(), ctx.Params("*")), + strings.TrimSuffix(ctx.Req.URL.Path, ctx.Params("*")), ctx.Repo.BranchNameSubURL(), ctx.Repo.TreePath)) return -- cgit v1.2.3