Merge "Skip checksum validation on partial downloads"
This commit is contained in:
commit
1d57403668
@ -387,6 +387,7 @@ class _SwiftReader(object):
|
||||
# Some headers indicate the MD5 of the response
|
||||
# definitely *won't* match the ETag
|
||||
bad_md5_headers = set([
|
||||
'content-range',
|
||||
'x-object-manifest',
|
||||
'x-static-large-object',
|
||||
])
|
||||
|
@ -141,6 +141,16 @@ class TestSwiftReader(unittest.TestCase):
|
||||
self.assertFalse(sr._expected_md5)
|
||||
self.assertIsNone(sr._actual_md5)
|
||||
|
||||
def test_create_with_content_range_header(self):
|
||||
# md5 should not be initialized if large object headers are present
|
||||
sr = self.sr('path', 'body', {'content-range': 'bytes 0-3/10',
|
||||
'etag': '"%s"' % ('0' * 32)})
|
||||
self.assertEqual(sr._path, 'path')
|
||||
self.assertEqual(sr._body, 'body')
|
||||
self.assertIsNone(sr._content_length)
|
||||
self.assertFalse(sr._expected_md5)
|
||||
self.assertIsNone(sr._actual_md5)
|
||||
|
||||
def test_create_with_ignore_checksum(self):
|
||||
# md5 should not be initialized if checksum is False
|
||||
sr = self.sr('path', 'body', {}, False)
|
||||
|
Loading…
x
Reference in New Issue
Block a user