From 65421b49c49c6906ca1fc497a76e68cb85854534 Mon Sep 17 00:00:00 2001 From: hanbing0715 Date: Mon, 9 Oct 2023 20:00:30 +0800 Subject: [PATCH] Add x-amz-content-sha256 to CanonicalHeaders --- common/etc/nginx/include/awssig4.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/etc/nginx/include/awssig4.js b/common/etc/nginx/include/awssig4.js index 6af15a55..fb7be86f 100644 --- a/common/etc/nginx/include/awssig4.js +++ b/common/etc/nginx/include/awssig4.js @@ -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 @@ -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) {