1
1
mirror of https://github.com/go-gitea/gitea synced 2025-08-04 00:28:36 +00:00

Fix raw file API ref handling (#33172) (#33189)

Backport #33172 by wxiaoguang

Fix #33164 and add more tests

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Giteabot
2025-01-10 10:41:28 +08:00
committed by GitHub
parent 15ad001aef
commit 45d21a0d5c
3 changed files with 48 additions and 43 deletions

View File

@@ -305,8 +305,7 @@ func RepoRefForAPI(next http.Handler) http.Handler {
return
}
// NOTICE: the "ref" here for internal usage only (e.g. woodpecker)
refName, _ := getRefNameLegacy(ctx.Base, ctx.Repo, ctx.FormTrim("ref"))
refName, _ := getRefNameLegacy(ctx.Base, ctx.Repo, ctx.PathParam("*"), ctx.FormTrim("ref"))
var err error
if ctx.Repo.GitRepo.IsBranchExist(refName) {