Skip to content
This repository was archived by the owner on Apr 20, 2024. It is now read-only.

Commit b34ae48

Browse files
committed
Potential Linux fix for get UTF-8.
1 parent 86fc6eb commit b34ae48

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Sources/Driver/Authentication/Authentication.swift

+7-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ struct Authentication {
2828
charactersIn: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-._~="
2929
)
3030

31+
static let awsPathAllowed = CharacterSet(
32+
charactersIn: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-._~/"
33+
)
34+
3135
var amzDate: String {
3236
let dateFormatter = DateFormatter()
3337
dateFormatter.timeZone = TimeZone(secondsFromGMT: 0)
@@ -50,7 +54,9 @@ struct Authentication {
5054
self.host = host
5155
self.region = region
5256
//TODO(Brett): Proper encoding and error handling.
53-
self.baseURL = baseURL.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed)!
57+
self.baseURL = baseURL.addingPercentEncoding(
58+
withAllowedCharacters: Authentication.awsPathAllowed
59+
)!
5460
self.key = key
5561
self.secret = secret
5662
self.requestParam = requestParam?.addingPercentEncoding(

0 commit comments

Comments
 (0)