Skip to content

Commit

Permalink
Remove content-sha256 when unsigned
Browse files Browse the repository at this point in the history
  • Loading branch information
Arne Molland authored and arnemolland committed Feb 17, 2021
1 parent 2cdf751 commit 0ab927d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions lib/src/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,9 @@ class Sigv4Client implements BaseSigv4Client {
body = '';
}

headers[_x_amz_content_sha256] =
signPayload ? Sigv4.hashPayload(body) : _unsigned_payload;
if (signPayload) {
headers[_x_amz_content_sha256] = signPayload;
}

if (body == '') {
headers.remove('Content-Type');
Expand Down
4 changes: 2 additions & 2 deletions lib/src/sigv4.dart
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ class Sigv4 {
accessKey +
'/' +
credentialScope +
',SignedHeaders=' +
', SignedHeaders=' +
buildCanonicalSignedHeaders(headers) +
',Signature=' +
', Signature=' +
signature;
}

Expand Down

0 comments on commit 0ab927d

Please sign in to comment.