Skip to content

Commit

Permalink
Removed the content length as this is a possible cause of the 'The pr…
Browse files Browse the repository at this point in the history
…ovided 'x-amz-content-sha256' header does not match what was computed.' error (checkout aws/aws-sdk-go#148 (comment) )
  • Loading branch information
Erik Terwan committed Apr 18, 2019
1 parent 5752320 commit f0b5cb4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 3 deletions.
1 change: 0 additions & 1 deletion Sources/S3Signer/S3Signer+Private.swift
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ extension S3Signer {
}

if httpMethod == .PUT || httpMethod == .DELETE {
updatedHeaders["content-length"] = payload.size()
if httpMethod == .PUT && url.pathExtension != "" {
updatedHeaders["content-type"] = (MediaType.fileExtension(url.pathExtension) ?? .plainText).description
}
Expand Down
2 changes: 0 additions & 2 deletions Tests/S3Tests/S3SignerAWSTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,7 @@ class S3SignerAWSTests: BaseTestCase {
payload: .bytes(randomBytesMessage),
dates: overridenDate)

XCTAssertNotNil(headers["Content-Length"].first)
XCTAssertNotNil(headers["Content-Type"].first)
XCTAssertEqual(headers["Content-Length"].first, Payload.bytes(randomBytesMessage).size())
XCTAssertEqual(headers["Content-Type"].first, "text/plain")
}

Expand Down

0 comments on commit f0b5cb4

Please # to comment.