Skip to content

Commit d2e5c7f

Browse files
committed
chore: simply replace occurences of +
1 parent a19dbe0 commit d2e5c7f

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

templates/apple/Sources/Client.swift.twig

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ import AsyncHTTPClient
99
let DASHDASH = "--"
1010
let CRLF = "\r\n"
1111

12-
extension CharacterSet {
13-
static let rfc3986Unreserved = CharacterSet(charactersIn: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~")
14-
}
15-
1612
open class Client {
1713

1814
// MARK: Properties
@@ -218,8 +214,8 @@ open class Client {
218214
}
219215

220216
return output.addingPercentEncoding(
221-
withAllowedCharacters: .rfc3986Unreserved
222-
) ?? ""
217+
withAllowedCharacters: .urlHostAllowed
218+
)?.replacingOccurrences(of: "+", with: "%2B") ?? ""
223219
}
224220

225221
///

templates/swift/Sources/Client.swift.twig

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ import AsyncHTTPClient
99
let DASHDASH = "--"
1010
let CRLF = "\r\n"
1111

12-
extension CharacterSet {
13-
static let rfc3986Unreserved = CharacterSet(charactersIn: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~")
14-
}
15-
1612
open class Client {
1713

1814
// MARK: Properties
@@ -195,8 +191,8 @@ open class Client {
195191
}
196192

197193
return output.addingPercentEncoding(
198-
withAllowedCharacters: .rfc3986Unreserved
199-
) ?? ""
194+
withAllowedCharacters: .urlHostAllowed
195+
)?.replacingOccurrences(of: "+", with: "%2B") ?? ""
200196
}
201197

202198
///

0 commit comments

Comments
 (0)