Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ extension AWSCognitoAuthPlugin {
return { request in
try await signAppSyncRequest(
request,

region: region
region: region
)
}
}
Expand Down Expand Up @@ -113,8 +112,6 @@ extension AWSCognitoAuthPlugin {
}

var headers = urlRequest.allHTTPHeaderFields ?? [:]
headers.updateValue(host, forKey: "host")

let httpMethod = (urlRequest.httpMethod?.uppercased())
.flatMap(HTTPMethodType.init(rawValue:)) ?? .get

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ class AWSCognitoAuthPluginAppSyncSignerTests: XCTestCase {
XCTAssertEqual(request.method, .post)
XCTAssertEqual(request.endpoint.port, 443)
XCTAssertEqual(request.endpoint.protocolType, .https)
XCTAssertEqual(request.endpoint.headers.headers, [.init(name: "host", value: "graphql.com")])
guard case let .data(data) = request.body else {
XCTFail("Unexpected body")
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ class AppSyncSignerTests: AWSAuthBaseTest {
XCTFail("Missing headers")
return
}
XCTAssertEqual(headers.count, 4)
XCTAssertEqual(headers.count, 3)
let containsExpectedHeaders = headers.keys.contains(where: { key in
key == "Authorization" || key == "Host" || key == "X-Amz-Security-Token" || key == "X-Amz-Date"
key == "Authorization" || key == "X-Amz-Security-Token" || key == "X-Amz-Date"
})
XCTAssertTrue(containsExpectedHeaders)
}
Expand Down
Loading