1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-05 18:17:19 +00:00

Fix "redirect link" handling (#33440)

`a%2fb` should not redirect to `a/b`

---------

Co-authored-by: delvh <dev.lh@web.de>
This commit is contained in:
wxiaoguang
2025-01-31 04:12:14 +08:00
committed by GitHub
parent f88dbf86b3
commit f24d73ab5f
7 changed files with 65 additions and 45 deletions

View File

@ -293,7 +293,7 @@ func RepoRefForAPI(next http.Handler) http.Handler {
return
}
refName, _ := getRefNameLegacy(ctx.Base, ctx.Repo, ctx.PathParam("*"), ctx.FormTrim("ref"))
refName, _, _ := getRefNameLegacy(ctx.Base, ctx.Repo, ctx.PathParam("*"), ctx.FormTrim("ref"))
var err error
if ctx.Repo.GitRepo.IsBranchExist(refName) {