Skip to content

Commit 1a51604

Browse files
committed
s3api: Look for more indications of aws-chunked uploads
Change-Id: I7dda8a25c9e13b0d81293f0a966c34713c93f6ad Related-Bug: 1810026
1 parent 34aef9d commit 1a51604

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

swift/common/middleware/s3api/s3request.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,10 @@ def _validate_headers(self):
749749

750750
# https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-streaming.html
751751
# describes some of what would be required to support this
752-
if 'aws-chunked' in self.headers.get('content-encoding', ''):
752+
if any(['aws-chunked' in self.headers.get('content-encoding', ''),
753+
'STREAMING-AWS4-HMAC-SHA256-PAYLOAD' == self.headers.get(
754+
'x-amz-content-sha256', ''),
755+
'x-amz-decoded-content-length' in self.headers]):
753756
raise S3NotImplemented('Transfering payloads in multiple chunks '
754757
'using aws-chunked is not supported.')
755758

test/unit/common/middleware/s3api/test_s3api.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,11 @@ def test_aws_chunked(self):
574574
# > That is, you can specify your custom content-encoding when using
575575
# > Signature Version 4 streaming API.
576576
self._test_unsupported_header('Content-Encoding', 'aws-chunked,gzip')
577+
# Some clients skip the content-encoding,
578+
# such as minio-go and aws-sdk-java
579+
self._test_unsupported_header('x-amz-content-sha256',
580+
'STREAMING-AWS4-HMAC-SHA256-PAYLOAD')
581+
self._test_unsupported_header('x-amz-decoded-content-length')
577582

578583
def test_object_tagging(self):
579584
self._test_unsupported_header('x-amz-tagging')

0 commit comments

Comments
 (0)