fix(node): Adjust Express URL parameterization for RegEx routes #5483
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 PR makes our URL parameterization for Express (introduced in #5450) compatible with RegEx-defined routes.
Previously, as reported in #5481, our parameterization logic would cause a crash because instead of a string, the matched route would be of type
RegExp
. This PR adjusts our logic so that we detect if we get a matched string our regex.In the latter case, we also append a
'/'
to the reconstructed partial route name so that the regex is closed.Generally, with this approach, regex routes' transaction names should be identical to what they were before #5450 (with the exception of child routes that are parameterized now).
fixes #5481