Fix #424: Escape question mark '?'

It would otherwise be interpreted as the beginning of the query part in an URL.
This commit is contained in:
Danny Moesch 2020-11-07 13:30:38 +01:00 committed by Mingshen Sun
parent 17ce107129
commit eba4df2f51
2 changed files with 3 additions and 3 deletions

View file

@ -12,7 +12,7 @@ public extension String {
}
func stringByAddingPercentEncodingForRFC3986() -> String? {
let unreserved = "-._~/?"
let unreserved = "-._~/"
var allowed = CharacterSet.alphanumerics
allowed.insert(charactersIn: unreserved)
return addingPercentEncoding(withAllowedCharacters: allowed)