Skip to content

Fix an issue where % was getting double encoded in query params #698

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

Merged
merged 1 commit into from
Apr 19, 2023

Conversation

dhwaneetbhatt
Copy link
Contributor

@dhwaneetbhatt dhwaneetbhatt commented Apr 18, 2023

As part of #638, we moved the encoding to the modules, which led to double encoding.

The fix would be to remove double encoding and make this fix in all other modules as well which are now doing double encoding of %.

@dhwaneetbhatt dhwaneetbhatt requested a review from webholik April 18, 2023 05:07
@dhwaneetbhatt dhwaneetbhatt self-assigned this Apr 18, 2023
@dhwaneetbhatt dhwaneetbhatt requested a review from VShingala April 18, 2023 05:38
@dhwaneetbhatt dhwaneetbhatt force-pushed the bug/fix-double-encoding-for-percent branch 4 times, most recently from 0315022 to d00b39d Compare April 18, 2023 13:27
@dhwaneetbhatt dhwaneetbhatt force-pushed the bug/fix-double-encoding-for-percent branch from d00b39d to c076f20 Compare April 18, 2023 18:11
@dhwaneetbhatt dhwaneetbhatt requested a review from VShingala April 19, 2023 05:04
.replace(/%5D/g, ']')
.replace(/%7D/g, '}')
.replace(/%25/g, '%')
Copy link
Member

Choose a reason for hiding this comment

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

@dhwaneetbhatt Any reason to not encode { and } here anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@VShingala In Java-unirest library, using characters { and } resulted in IllegalURLException being thrown by the library. We caught this now only because we added a Newman test. So we cannot have those characters in the URL. This is not a problem with other Java libraries (OkHttp) so seems like a bug with unirest.

@dhwaneetbhatt dhwaneetbhatt merged commit 3863c4d into develop Apr 19, 2023
@dhwaneetbhatt dhwaneetbhatt deleted the bug/fix-double-encoding-for-percent branch April 19, 2023 08:24
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