Skip to content

Commit 5caea33

Browse files
authored
Merge pull request ceph#65723 from mheler/rgw_cloud_transition_header_fix
rgw/s3: Always include x-amz-content-sha256 header in AWS v4 signatures Reviewed-by: Casey Bodley <[email protected]>
2 parents 6161d1e + 4429c7b commit 5caea33

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/rgw/rgw_rest_s3.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6368,7 +6368,11 @@ AWSSignerV4::prepare(const DoutPrefixProvider *dpp,
63686368
if (opt_content) {
63696369
content_hash = rgw::auth::s3::calc_v4_payload_hash(opt_content->to_str());
63706370
extra_headers["x-amz-content-sha256"] = content_hash;
6371-
6371+
} else {
6372+
/* Some S3-compatible services require x-amz-content-sha256 header to always
6373+
* be present and included in the signature, even for unsigned payload.
6374+
* AWS S3 specification states that this header is required for all requests. */
6375+
extra_headers["x-amz-content-sha256"] = AWS4_UNSIGNED_PAYLOAD_HASH;
63726376
}
63736377

63746378
/* craft canonical headers */

0 commit comments

Comments
 (0)