forked from shadowfacts/Tusker
Pachyderm: Fix request bodies form parameters not being percent-escaped
Fixes #65
This commit is contained in:
parent
afc2bfcf6b
commit
6831ab5385
|
@ -67,8 +67,11 @@ extension Parameter: CustomStringConvertible {
|
|||
extension Array where Element == Parameter {
|
||||
var urlEncoded: String {
|
||||
return compactMap {
|
||||
guard let value = $0.value else { return nil }
|
||||
return "\($0.name)=\(value)"
|
||||
guard let value = $0.value,
|
||||
let escapedValue = value.addingPercentEncoding(withAllowedCharacters: .alphanumerics) else {
|
||||
return nil
|
||||
}
|
||||
return "\($0.name)=\(escapedValue)"
|
||||
}.joined(separator: "&")
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue