Skip to content

Commit 1025aa9

Browse files
nevilgh-action-runner
authored andcommitted
Percent encode semicolons when using GET (apollographql/apollo-ios-dev#812)
1 parent 90eae90 commit 1025aa9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Sources/Apollo/URLQueryParameterTransformer.swift

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

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

5455
return components.url
5556
}

0 commit comments

Comments
 (0)