Support Content-MD5 header for multipart uploads
According to https://docs.aws.amazon.com/AmazonS3/latest/API/mpUploadComplete.html:
The entity tag is an opaque string. The entity tag may or may not be an MD5 digest of the object data. If the entity tag is not an MD5 digest of the object data, it will contain one or more nonhexadecimal characters and/or will consist of less than 32 or more than 32 hexadecimal digits.
As seen in !398 (closed) and https://gitlab.com/gitlab-org/quality/nightly/issues/101, Amazon S3 has moved away from using the MD5 hashes in the ETag header for multipart uploads. The ETag value is now an opaque value. Instead, clients are supposed to send up each part with the Content-MD5
header. The PUT operation will fail if the MD5 doesn't match that.
However, attempting to set this header in Workhorse will fail with Bad Request
. Since Rails generates pre-signed URLs for the PUT requests, this header can't be set by Workhorse.
We either have to move the signing of the PUT requests to Workhorse, or give Rails the MD5 sums for each part.