-
-
Notifications
You must be signed in to change notification settings - Fork 397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: use re.match instead of re.search for mounted app path (#3501) #3511
fix: use re.match instead of re.search for mounted app path (#3501) #3511
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3511 +/- ##
=======================================
Coverage 98.28% 98.28%
=======================================
Files 328 328
Lines 14882 14882
Branches 2367 2367
=======================================
Hits 14627 14627
Misses 116 116
Partials 139 139 ☔ View full report in Codecov by Sentry. |
I'm trying to figure this out for myself - its almost as though it is designed to match against a sub-path and then extract the mount path component.. but why.. I'm not sure.. I'll spend more time trying to figure it out. On the plus side, your implementation doesn't break any tests - so maybe it is just a weirdness that exists due to code evolution or whatever, but I'd like to take a bit of time to think it through. |
ec8e3a2
to
2f3adbb
Compare
@provinzkraut My best guess with this is that it was required before we started handling |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @0xE111 - I'm just waiting on another set of eyes on that path slicing business before we merge.
2f3adbb
to
3648437
Compare
Documentation preview will be available shortly at https://litestar-org.github.io/litestar-docs-preview/3511 |
Can't come up with a better explanation, so I'd say it's okay to merge this as is! |
@all-contributors add @0xE111 for code |
I've put up a pull request to add @0xE111! 🎉 |
Description
See #3501 for detailed description.
TL;DR: When mounting an app, path resolution uses
re.search
instead orre.match
, thus mounted app matches any path which contains mount path.Original code used
re.search
and had explicit "sub-path match" (path[match.start() : match.end()]
) which makes me think there was some reasoning behindre.search
but tbh I don't get it:Closes
Fixes #3501