Fix RPM Registry 404 when package name contains 'package'#37087
Conversation
Swap the order of overlapping routes in api.go to prevent the short route from intercepting long paths when the name contains 'package'. Fixes go-gitea#37086 Signed-off-by: Rohan Guliani <rohansguliani@google.com>
bircni
left a comment
There was a problem hiding this comment.
Fix is correct.
I would really like to see a Comment here to explain why we do this.
The root cause is still unfixed though.
The real issue is that <group:*> using (.*?) across / boundaries creates ambiguity with the literal package/ segment.
Also I think a test would be great for this to cover...
Signed-off-by: Rohan Guliani <rohansguliani@google.com>
|
Good catch! Thank you very much. btw: I think we can do more "fixes", I will do it, just a moment. |
|
It is a bug in "MatchPath", the generated regexp is |
|
Completely fixed in the framework. |
|
Now, even if you swap the two MatchPath routes to old order, the test still passes. Everything should be right now. Will do final clean up and mark it ready for review. |
* main: Fix RPM Registry 404 when package name contains 'package' (go-gitea#37087) Improve actions notifier for `workflow_run` (go-gitea#37088) Refactor code render and render control chars (go-gitea#37078) Fix various problems (go-gitea#37077) [skip ci] Updated translations via Crowdin Support legacy run/job index-based URLs and refactor migration 326 (go-gitea#37008) Fix a bug when forking a repository in an organization (go-gitea#36950)
Fixes #37086, fix the bug in MatchPath, and swap the order of overlapping routes in api.go to make it look better.