mirror of
https://github.com/go-gitea/gitea.git
synced 2026-04-07 11:25:23 +02:00
Fix RPM Registry 404 when package name contains 'package'
Swap the order of overlapping routes in api.go to prevent the short route from intercepting long paths when the name contains 'package'. Fixes #37086 Signed-off-by: Rohan Guliani <rohansguliani@google.com>
This commit is contained in:
parent
2158cf6e12
commit
86215d5212
@ -473,8 +473,8 @@ func CommonRoutes() *web.Router {
|
||||
g.MatchPath("GET", "/<group:*>/repodata/<filename>", rpm.GetRepositoryFile)
|
||||
g.MatchPath("PUT", "/<group:*>/upload", reqPackageAccess(perm.AccessModeWrite), rpm.UploadPackageFile)
|
||||
// this URL pattern is only used internally in the RPM index, it is generated by us, the filename part is not really used (can be anything)
|
||||
g.MatchPath("HEAD,GET", "/<group:*>/package/<name>/<version>/<architecture>", rpm.DownloadPackageFile)
|
||||
g.MatchPath("HEAD,GET", "/<group:*>/package/<name>/<version>/<architecture>/<filename>", rpm.DownloadPackageFile)
|
||||
g.MatchPath("HEAD,GET", "/<group:*>/package/<name>/<version>/<architecture>", rpm.DownloadPackageFile)
|
||||
g.MatchPath("DELETE", "/<group:*>/package/<name>/<version>/<architecture>", reqPackageAccess(perm.AccessModeWrite), rpm.DeletePackageFile)
|
||||
}, reqPackageAccess(perm.AccessModeRead))
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user