Merge "Ignore Content-Type from client when deleting multi-part objects"
This commit is contained in:
commit
f883d8535e
@ -123,6 +123,7 @@ class ObjectController(Controller):
|
||||
"""
|
||||
try:
|
||||
query = req.gen_multipart_manifest_delete_query(self.app)
|
||||
req.headers['Content-Type'] = None # Ignore client content-type
|
||||
resp = req.get_response(self.app, query=query)
|
||||
if query and resp.status_int == HTTP_OK:
|
||||
for chunk in resp.app_iter:
|
||||
|
@ -679,7 +679,8 @@ class TestSwift3Obj(Swift3TestCase):
|
||||
req = Request.blank('/bucket/object',
|
||||
environ={'REQUEST_METHOD': 'DELETE'},
|
||||
headers={'Authorization': 'AWS test:tester:hmac',
|
||||
'Date': self.get_date_header()})
|
||||
'Date': self.get_date_header(),
|
||||
'Content-Type': 'foo/bar'})
|
||||
status, headers, body = self.call_swift3(req)
|
||||
self.assertEqual(status.split()[0], '204')
|
||||
self.assertEqual(body, '')
|
||||
@ -689,13 +690,14 @@ class TestSwift3Obj(Swift3TestCase):
|
||||
self.assertIn(('DELETE', '/v1/AUTH_test/bucket/object'
|
||||
'?multipart-manifest=delete'),
|
||||
self.swift.calls)
|
||||
_, path = self.swift.calls[-1]
|
||||
_, path, headers = self.swift.calls_with_headers[-1]
|
||||
path, query_string = path.split('?', 1)
|
||||
query = {}
|
||||
for q in query_string.split('&'):
|
||||
key, arg = q.split('=')
|
||||
query[key] = arg
|
||||
self.assertEquals(query['multipart-manifest'], 'delete')
|
||||
self.assertNotIn('Content-Type', headers)
|
||||
|
||||
def _test_object_for_s3acl(self, method, account):
|
||||
req = Request.blank('/bucket/object',
|
||||
|
Loading…
x
Reference in New Issue
Block a user