Skip to content

Commit 4375ddb

Browse files
AnthonyMDevgh-action-runner
authored andcommitted
Percent encode semicolons when using GET (apollographql/apollo-ios-dev#840)
1 parent bf71e9c commit 4375ddb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Sources/Apollo/GraphQLGETTransformer.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ public struct GraphQLGETTransformer {
4949
components.queryItems = queryItems
5050
}
5151

52+
let allowedCharacters = CharacterSet(charactersIn: "+;").inverted
5253
components.percentEncodedQuery =
53-
components.percentEncodedQuery?.replacingOccurrences(of: "+", with: "%2B")
54+
components.percentEncodedQuery?.addingPercentEncoding(withAllowedCharacters: allowedCharacters)
5455

5556
return components.url
5657
}

0 commit comments

Comments
 (0)