-
Notifications
You must be signed in to change notification settings - Fork 743
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 encoding of + in parameters for GET urls #1653
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests look reasonable but I think mayyybe there's a different solution here?
@@ -43,6 +43,8 @@ public struct GraphQLGETTransformer { | |||
} | |||
|
|||
components.queryItems = queryItems | |||
components.percentEncodedQuery = | |||
components.percentEncodedQuery?.replacingOccurrences(of: "+", with: "%2B") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this needs to actually be replaced in the query items rather than in the percent encoded query for it to essentially get re-percent-encoded so it's not read by the server as a raw string.
…y to the encoded query" This reverts commit f69f32b.
0fe7c9d
to
e60e793
Compare
Ran this through a couple different URL decoders and discovered that @AnthonyMDev's fix is the correct one - my fix would get decoded as |
Since this is passing URL decoders, I'm going to go ahead and merge this. I'll re-open #1652 if merging this auto-closes since we're still waiting for a bit of feedback on that. |
Fixes #1652