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

fix(node): Adjust Express URL parameterization for RegEx routes #5483

Merged
merged 3 commits into from Jul 28, 2022

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Jul 28, 2022

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

@Lms24 Lms24 self-assigned this Jul 28, 2022
@Lms24 Lms24 marked this pull request as ready for review July 28, 2022 11:08
@Lms24 Lms24 requested a review from AbhiPrasad July 28, 2022 11:11
Copy link
Member

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would like to see a test, but can live without it

@Lms24
Copy link
Member Author

Lms24 commented Jul 28, 2022

Good point, lemme see what I can do

@Lms24 Lms24 force-pushed the lms-fix-partialRoute-split branch from 07af6f7 to 01eb648 Compare July 28, 2022 13:50
@Lms24 Lms24 merged commit e849076 into master Jul 28, 2022
@Lms24 Lms24 deleted the lms-fix-partialRoute-split branch July 28, 2022 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TypeError: partialRoute.split is not a function
2 participants