From be6f50f14fb78fedf4d32b2f51524cc7ad04e57f Mon Sep 17 00:00:00 2001 From: Marius Date: Mon, 25 Jul 2022 13:48:08 +0200 Subject: [PATCH] s3store: Only disable signatures for UploadPart, if -s3-disable-content-hashes is used --- cmd/tusd/cli/composer.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmd/tusd/cli/composer.go b/cmd/tusd/cli/composer.go index 25df09d..70e8eec 100644 --- a/cmd/tusd/cli/composer.go +++ b/cmd/tusd/cli/composer.go @@ -43,7 +43,12 @@ func CreateComposer() { if Flags.S3DisableContentHashes { // Prevent the S3 service client from automatically // adding the Content-MD5 header to S3 Object Put and Upload API calls. - s3Config = s3Config.WithS3DisableContentMD5Validation(true) + // + // Note: For now, we do not set S3DisableContentMD5Validation because when terminating an upload, + // a signature is required. If not present, S3 will complain: + // InvalidRequest: Missing required header for this request: Content-MD5 OR x-amz-checksum-* + // So for now, this flag will only cause hashes to be disabled for the UploadPart operation (see s3store.go). + //s3Config = s3Config.WithS3DisableContentMD5Validation(true) } if Flags.S3DisableSSL {