Merge pull request #1707 from Whamied/etag-no-quote-patch

Added support for multipart upload completion with unquoted etags
This commit is contained in:
Steve Pulec 2018-07-19 10:05:07 -04:00 committed by GitHub
commit 0309d1ec39
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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