Fix PathPattern encoding #1321
Merged
Merged
Conversation
MihaZupan
approved these changes
Oct 25, 2021
Member
MihaZupan
left a comment
There was a problem hiding this comment.
So aside from the change in undesired escaping, I take it the observable behavior from the user's perspective is the same here?
Member
Author
The biggest change is the clarification that the user needs to use the ** syntax in two places, in the route match and in the transform. Otherwise everything else should work as before. |
Member
Author
|
Waiting on a review from Javier. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #1307
Sample route from the issue:
PathPattern is supposed to take route parameters matched from the path and inject them into the given pattern.
**in the path pattern indicates a catch-all that will capture the remainder of the path.Problem: When the catch-all captured multiple path segments the resulting path would have the
/'s escaped as %2F. You should have been able to specify the PathPattern as{ "PathPattern": "/{**remainder}" },to avoid this, but it doesn't work with the RouteTemplate type we're using.Solution: Use RoutePattern instead of RouteTemplate. This comes with a few usage differences.
defaultsparameter to avoid the prior issue, but with RoutePattern it would cause default segments to be dropped. We no longer pass in the defaults collection.