Skip to content

[webclient] bug fix to double URL encoding - #8660

Merged
wing328 merged 1 commit into
OpenAPITools:masterfrom
zapek:bugfix/remove-double-url-encoding
Mar 15, 2021
Merged

[webclient] bug fix to double URL encoding#8660
wing328 merged 1 commit into
OpenAPITools:masterfrom
zapek:bugfix/remove-double-url-encoding

Conversation

@zapek

@zapekzapek commented Feb 9, 2021

Copy link
Copy Markdown
Contributor

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

wing328 commented Mar 15, 2021

Copy link
Copy Markdown
Member

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:masterMar 15, 2021
@wing328wing328 changed the title fix: remove double URL encoding[webclient] bug fix to double URL encodingMar 15, 2021
@wing328wing328 added this to the 5.1.0 milestone Mar 15, 2021
@wing328

Copy link
Copy Markdown
Member

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

@wing328

Copy link
Copy Markdown
Member

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

@fbecaria

fbecaria commented Feb 2, 2022

Copy link
Copy Markdown

@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 freeto 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.

3 participants

@zapek@wing328@fbecaria