Added support for multipart upload confirmation with unquoted etags

This commit is contained in:
Waleed Hamied 2018-07-03 15:36:41 -04:00
commit f8fdd439ad
2 changed files with 28 additions and 2 deletions

View file

@ -175,11 +175,14 @@ class FakeMultipart(BaseModel):
count = 0
for pn, etag in body:
part = self.parts.get(pn)
if part is None or part.etag != etag:
part_etag = None
if part is not None:
part_etag = part.etag.replace('"', '')
etag = etag.replace('"', '')
if part is None or part_etag != etag:
raise InvalidPart()
if last is not None and len(last.value) < UPLOAD_PART_MIN_SIZE:
raise EntityTooSmall()
part_etag = part.etag.replace('"', '')
md5s.extend(decode_hex(part_etag)[0])
total.extend(part.value)
last = part