Skip to content

Prioritizing route parameter over query parameter #95

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

Conversation

juancamunozfp
Copy link

We are encountering an issue that arises when a route has a route parameter and the URL query string also contains a parameter with the same name as the route parameter.

This modification ensures that the route parameter value takes precedence over the query parameter with the same name

@ivanvermeyen
Copy link
Contributor

Hi,

Thank you for the PR!

I was able to produce the issue in a test, but your proposed solution would remove the query string parameter, which is probably also undesirable.

Instead, I have split the query string parameters from the route parameters and appended them manually.

See commit: fac6e4a

I tagged this in release 3.1.3.
Let me know if this fixes your issue. 👍

@juancamunozfp
Copy link
Author

Hi,

Thank you for the PR!

I was able to produce the issue in a test, but your proposed solution would remove the query string parameter, which is probably also undesirable.

Instead, I have split the query string parameters from the route parameters and appended them manually.

See commit: fac6e4a

I tagged this in release 3.1.3. Let me know if this fixes your issue. +1

Thank you for your reply, yes, It works well!!

I prefer also your implementation, so I'll close the pr now that the issue has been solved.

Once again, thank you very much!

@juancamunozfp juancamunozfp deleted the fix-duplicated-url-params branch May 2, 2023 11:45
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.

2 participants