Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This upgrades path-to-regexp to the latest version.
The behaviour has changed quite a lot since the previous version we were using. Some examples of what has changed:
/foo/(.*)
rather than/foo/*
http://foo
would think://foo
or something is a parameter)foo?bar
must befoo\\?bar
since you can now have optional parameters like/foo/:bar?
To account for this in the most backwards compatible way possible, this change does the following:
://
in URLs and escapes it to\\://
/*
in URLs and converts it to/(.*)
foo?bar
will no longer behave the same. you must escape,foo\\?bar
The breaking change with query strings is because we can't really reliably replace
?
automatically with\\?
, since consumers may legitimately want to use the new optional parameters functionality.Notes/questions
path-to-regexp
, i.e. do no detection of backwards compat stuff, just tell consumers to use(.*)
and escape:
from now on. Thoughts?