Skip to content
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

upgrade path-to-regexp package? #3142

Closed
hellatan opened this issue Nov 27, 2016 · 7 comments
Closed

upgrade path-to-regexp package? #3142

hellatan opened this issue Nov 27, 2016 · 7 comments

Comments

@hellatan
Copy link

I filed this bug with the path-to-regexp package. However, I noticed that express@3.14.x is currently using path-to-regexp@0.1.7. I did a test install with path-to-regexp@1.7.0 and my local instance stopped having those issues in the ticket I linked to.

@dougwilson
Copy link
Contributor

dougwilson commented Nov 27, 2016

Thanks for the poke :) we already have several issues about this and even a PR. Since the upgrade is not backwards compatible it can't be done until express 5.0. I'm going to close this since we have several others open :)

@hellatan
Copy link
Author

wow that was fast 😄 good to know and I meant to say express@4.14.x, not 3.1.4x. So this upgrade will happen when 5.x is released?

@dougwilson
Copy link
Contributor

Yes

@hellatan
Copy link
Author

@dougwilson can you suggest any workarounds? The only one I can think of based on what you've said is to fork the express@4.x and upgrade the path-to-regexp package in that fork until we can upgrade to 5.x.

@dougwilson
Copy link
Contributor

Wait until the main person of the module replies to your bug. That module is part of the Express project, so it's possible there is a bug fix made to the 0.1.x line, which has happened several times. It depends on what the issue is.

Otherwise, just provide a regular expression as your path to express directly instead of a string and you can use whatever kind of expression you desire.

@dougwilson
Copy link
Contributor

For example, your bug report has:

router.use('/(segment1|segment2|segment3)', someMethod);

You can use the array syntax for that:

router.use(['/segment1', '/segment2', '/segment3'], someMethod);

@hellatan
Copy link
Author

i went with using an actual regex instead. thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants