Skip to content

Commit

Permalink
Add x-amz-content-sha256 to CanonicalHeaders
Browse files Browse the repository at this point in the history
  • Loading branch information
hanbing0715 authored Oct 9, 2023
1 parent 2134898 commit 65421b4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion common/etc/nginx/include/awssig4.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const mod_hmac = require('crypto');
* Constant defining the headers being signed.
* @type {string}
*/
const DEFAULT_SIGNED_HEADERS = 'host;x-amz-date';
const DEFAULT_SIGNED_HEADERS = 'host;x-amz-content-sha256;x-amz-date';

/**
* Create HTTP Authorization header for authenticating with an AWS compatible
Expand Down Expand Up @@ -76,6 +76,7 @@ function _buildCanonicalRequest(r,
method, uri, queryParams, host, amzDatetime, sessionToken) {
const payloadHash = awsHeaderPayloadHash(r);
let canonicalHeaders = 'host:' + host + '\n' +
'x-amz-content-sha256:' + payloadHash + '\n' +
'x-amz-date:' + amzDatetime + '\n';

if (sessionToken && sessionToken.length > 0) {
Expand Down

0 comments on commit 65421b4

Please sign in to comment.