Skip to content

Commit c938490

Browse files
committed
Fix tests
1 parent 0c391f0 commit c938490

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

Sources/DropboxClient/Auth.swift

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,12 @@ extension Auth {
132132
forHTTPHeaderField: "Content-Type"
133133
)
134134
request.httpBody = [
135-
"code": code,
136-
"grant_type": "authorization_code",
137-
"redirect_uri": config.redirectURI,
138-
"code_verifier": codeVerifier,
139-
"client_id": config.appKey,
140-
].map { key, value in "\(key)=\(value)" }
141-
.joined(separator: "&")
142-
.data(using: .utf8)
135+
"code=\(code)",
136+
"grant_type=authorization_code",
137+
"redirect_uri=\(config.redirectURI)",
138+
"code_verifier=\(codeVerifier)",
139+
"client_id=\(config.appKey)",
140+
].joined(separator: "&").data(using: .utf8)
143141

144142
return request
145143
}()

Tests/DropboxClientTests/AuthTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ final class AuthTests: XCTestCase {
193193
].joined(separator: "&").data(using: .utf8)!
194194

195195
XCTAssertEqual($0, [expectedRequest])
196+
XCTAssertEqual($0.first?.httpBody, expectedRequest.httpBody!)
196197
}
197198
await credentials.withValue {
198199
XCTAssertEqual($0, Credentials(

0 commit comments

Comments
 (0)