-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
[now-routing-utils] Add replacing of multi-match characters #3446
Conversation
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.
Given this affects rewrites too, can we add tests there as well
Added tests for rewrites also |
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.
Let's use compile()
like we discussed.
compile('/:user/:users')({ user: '$1', users: '$2' })
compile('/:user*/:users')({ user: '$1', users: '$2' })
compile('/:user/:user')({ user: '$1' })
Updated to use |
Co-Authored-By: Steven <steven@ceriously.com>
Codecov Report
@@ Coverage Diff @@
## master #3446 +/- ##
=======================================
Coverage 14.56% 14.56%
=======================================
Files 267 267
Lines 10784 10784
Branches 1482 1482
=======================================
Hits 1571 1571
Misses 9047 9047
Partials 166 166 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.
I think we need a few additional tests for full URLs such as
{ source: '/firebase/:id', destination: 'https://:id.firebase.com' }
{ source: '/firebase/:id', destination: 'https://:id.firebase.com:8080' }
{ source: '/firebase/:id', destination: 'https://www.firebase.com:8080?userid=:id' }
Added more tests as we talked about |
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.
Amazing work 🎉
This makes sure to replace multi-match characters used in
path-to-regexp
when converting redirects.Fixes
/:path*/
being converted to/$1*/
and now converts it to/$1/