render part upload response correctly
This commit is contained in:
parent
f25caa872d
commit
0b45622dcb
@ -133,8 +133,8 @@ def _key_response(request, full_url, headers):
|
|||||||
upload_id = query['uploadId'][0]
|
upload_id = query['uploadId'][0]
|
||||||
part_number = int(query['partNumber'][0])
|
part_number = int(query['partNumber'][0])
|
||||||
key = s3_backend.set_part(bucket_name, upload_id, part_number, body)
|
key = s3_backend.set_part(bucket_name, upload_id, part_number, body)
|
||||||
|
template = Template(S3_MULTIPART_UPLOAD_RESPONSE)
|
||||||
return '', dict(etag=key.etag)
|
return 200, headers, template.render(part=key)
|
||||||
|
|
||||||
if 'x-amz-copy-source' in request.headers:
|
if 'x-amz-copy-source' in request.headers:
|
||||||
# Copy key
|
# Copy key
|
||||||
@ -310,6 +310,12 @@ S3_MULTIPART_INITIATE_RESPONSE = """<?xml version="1.0" encoding="UTF-8"?>
|
|||||||
<UploadId>{{ upload_id }}</UploadId>
|
<UploadId>{{ upload_id }}</UploadId>
|
||||||
</InitiateMultipartUploadResult>"""
|
</InitiateMultipartUploadResult>"""
|
||||||
|
|
||||||
|
S3_MULTIPART_UPLOAD_RESPONSE = """<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<CopyPartResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
|
||||||
|
<LastModified>{{ part.last_modified_ISO8601 }}</LastModified>
|
||||||
|
<ETag>{{ part.etag }}</ETag>
|
||||||
|
</CopyPartResult>"""
|
||||||
|
|
||||||
S3_MULTIPART_COMPLETE_RESPONSE = """<?xml version="1.0" encoding="UTF-8"?>
|
S3_MULTIPART_COMPLETE_RESPONSE = """<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<CompleteMultipartUploadResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
|
<CompleteMultipartUploadResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
|
||||||
<Location>http://{{ bucket_name }}.s3.amazonaws.com/{{ key_name }}</Location>
|
<Location>http://{{ bucket_name }}.s3.amazonaws.com/{{ key_name }}</Location>
|
||||||
|
Loading…
Reference in New Issue
Block a user