s3api: Look for more indications of aws-chunked uploads

Change-Id: I7dda8a25c9e13b0d81293f0a966c34713c93f6ad
Related-Bug: 1810026
This commit is contained in:
Tim Burke
2018-11-29 17:55:55 -08:00
committed by Tim Burke
parent 34aef9d091
commit 1a51604b26
2 changed files with 9 additions and 1 deletions

View File

@@ -749,7 +749,10 @@ class S3Request(swob.Request):
# https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-streaming.html
# describes some of what would be required to support this
if 'aws-chunked' in self.headers.get('content-encoding', ''):
if any(['aws-chunked' in self.headers.get('content-encoding', ''),
'STREAMING-AWS4-HMAC-SHA256-PAYLOAD' == self.headers.get(
'x-amz-content-sha256', ''),
'x-amz-decoded-content-length' in self.headers]):
raise S3NotImplemented('Transfering payloads in multiple chunks '
'using aws-chunked is not supported.')

View File

@@ -574,6 +574,11 @@ class TestS3ApiMiddleware(S3ApiTestCase):
# > That is, you can specify your custom content-encoding when using
# > Signature Version 4 streaming API.
self._test_unsupported_header('Content-Encoding', 'aws-chunked,gzip')
# Some clients skip the content-encoding,
# such as minio-go and aws-sdk-java
self._test_unsupported_header('x-amz-content-sha256',
'STREAMING-AWS4-HMAC-SHA256-PAYLOAD')
self._test_unsupported_header('x-amz-decoded-content-length')
def test_object_tagging(self):
self._test_unsupported_header('x-amz-tagging')