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

[webclient] bug fix to double URL encoding #8660

Merged
merged 1 commit into from
Mar 15, 2021
Merged

[webclient] bug fix to double URL encoding #8660

merged 1 commit into from
Mar 15, 2021

Conversation

zapek
Copy link
Contributor

@zapek zapek commented Feb 9, 2021

DefaultWebClient() already encodes URL query parameters.

Without this PR, I have a request with title=foo bar which gets converted to title=foo%25%20bar.
With this PR, the request becomes title=foo%20bar

This fixes #8171

DefaultWebClient() already encodes URL query parameters.
@wing328
Copy link
Member

wing328 commented Mar 15, 2021

Tested locally and the result is good:

HTTP: GET /v2/pet/12345?query_test=foo%20bar HTTP/1.1

I'll update the sample after merging this PR into master.

I'll also try to come up with a PR later to update the dependencies as there are newer versions available.

@wing328 wing328 merged commit c0187f2 into OpenAPITools:master Mar 15, 2021
@wing328 wing328 changed the title fix: remove double URL encoding [webclient] bug fix to double URL encoding Mar 15, 2021
@wing328 wing328 added this to the 5.1.0 milestone Mar 15, 2021
@wing328
Copy link
Member

wing328 commented Mar 15, 2021

Filed #8972 to update webclient dependencies. Please kindly review when you've time.

@wing328
Copy link
Member

wing328 commented Mar 22, 2021

@zapek thanks for the PR, which has been included in the v5.1.0 release: https://twitter.com/oas_generator/status/1373636654024380423

@fbecaria
Copy link

fbecaria commented Feb 2, 2022

@wing328 A question regarding this issue, considering the example you mention before (which shows the change fix the issue), I see that fails if the query param include an "&". My solution so far is to remove encoding at all and encode query params manually.

@zapek zapek deleted the bugfix/remove-double-url-encoding branch February 2, 2022 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants