Disallow uploads with x-amz-tagging headers set

We don't support it yet, so return 501 Not Implemented.

Change-Id: Ie2f4bd1bfdb1bcbdf1a0f0db9d542b6057e9d2ec
This commit is contained in:
Christian Schwede 2018-08-08 04:55:53 -04:00
parent 79539eabf7
commit dcbdcb8f1c
2 changed files with 6 additions and 0 deletions

View File

@ -700,6 +700,9 @@ class S3Request(swob.Request):
raise S3NotImplemented('Transfering payloads in multiple chunks ' raise S3NotImplemented('Transfering payloads in multiple chunks '
'using aws-chunked is not supported.') 'using aws-chunked is not supported.')
if 'x-amz-tagging' in self.headers:
raise S3NotImplemented('Object tagging is not supported.')
@property @property
def body(self): def body(self):
""" """

View File

@ -487,6 +487,9 @@ class TestS3ApiMiddleware(S3ApiTestCase):
# > Signature Version 4 streaming API. # > Signature Version 4 streaming API.
self._test_unsupported_header('Content-Encoding', 'aws-chunked,gzip') self._test_unsupported_header('Content-Encoding', 'aws-chunked,gzip')
def test_object_tagging(self):
self._test_unsupported_header('x-amz-tagging')
def _test_unsupported_resource(self, resource): def _test_unsupported_resource(self, resource):
req = Request.blank('/error?' + resource, req = Request.blank('/error?' + resource,
environ={'REQUEST_METHOD': 'GET', environ={'REQUEST_METHOD': 'GET',