-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Support real regex rules for rewrite and proxy middleware #1767
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
Conversation
Fix Static files route not working
add tests
Codecov Report
@@ Coverage Diff @@
## master #1767 +/- ##
==========================================
+ Coverage 89.72% 89.74% +0.01%
==========================================
Files 32 32
Lines 2667 2672 +5
==========================================
+ Hits 2393 2398 +5
Misses 175 175
Partials 99 99
Continue to review full report at Codecov.
|
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.
Other than that comment copy paste looks good to me.
p.s. this is my observation
And we really should use more table driven tests and even maybe refactor some old tests to tables when touching different parts. Those sequential page length tests could have side-effect and pass only because some earlier scenario/testcase already changed some internal state that next test case touches by reusing objects.
@aldas Feel free to merge, if Goland is happy now too. |
Based on a real-world application using a workaround to ignore a part of the URL using
.+?
is not working anymore.Using
/prefix/*/*
is also problematic due to the greedy nature of our regex conversion.The behavior for handling regex (using QuoteMeta now) has been changed with PR #1630.
With this PR the rewrite middleware will be enhanced to also allow real regular expressions with capture groups.
The existing
Rules
can still be used and will be converted to the now publicRegexRules
. Both can be used together, as long as the resulting regex is not exactly the same as a regex generated from a rules section.Example for usage:
A separate PR for documentation will be created in https://github.com/labstack/echox