Skip to content

Commit

Permalink
Remove content-length header in s3 streams when signing
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-fowler committed Jan 14, 2021
1 parent 2b58ee4 commit b987f84
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Sources/SotoSignerV4/signer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@ public struct AWSSigner {
if let sessionToken = credentials.sessionToken {
headers.add(name: "x-amz-security-token", value: sessionToken)
}

// remove content-length header
headers.remove(name: "content-length")

// construct signing data. Do this after adding the headers as it uses data from the headers
let signingData = AWSSigner.SigningData(url: url, method: method, headers: headers, bodyHash: bodyHash, date: dateString, signer: self)
let signingKey = self.signingKey(date: signingData.date)
Expand Down

0 comments on commit b987f84

Please sign in to comment.