Skip to content

Commit

Permalink
Merge pull request tencentyun#39 from dt3310321/s3
Browse files Browse the repository at this point in the history
Add EnableMD5 for upload_part
  • Loading branch information
dt3310321 authored Apr 3, 2018
2 parents 557076c + 547f1bf commit ea347ab
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions qcloud_cos/cos_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,10 +598,6 @@ def upload_part(self, Bucket, Key, Body, PartNumber, UploadId, EnableMD5=False,
auth=CosS3Auth(self._conf._secret_id, self._conf._secret_key, Key),
data=Body)
response = dict()
logger.debug("local md5: {key}".format(key=rt.headers['ETag'][1:-1]))
logger.debug("cos md5: {key}".format(key=md5(Body).hexdigest()))
if md5(Body).hexdigest() != rt.headers['ETag'][1:-1]:
raise CosClientError("MD5 inconsistencies")
response['ETag'] = rt.headers['ETag']
return response

Expand Down

0 comments on commit ea347ab

Please sign in to comment.