Signed-off-by: Matthew N. Heler <matthew.heler@hotmail.com>
if (opt_content) {
content_hash = rgw::auth::s3::calc_v4_payload_hash(opt_content->to_str());
extra_headers["x-amz-content-sha256"] = content_hash;
-
+ } else {
+ /* Some S3-compatible services require x-amz-content-sha256 header to always
+ * be present and included in the signature, even for unsigned payload.
+ * AWS S3 specification states that this header is required for all requests. */
+ extra_headers["x-amz-content-sha256"] = AWS4_UNSIGNED_PAYLOAD_HASH;
}
/* craft canonical headers */