From 0b45622dcb10847a3b9980123bd9cbee81b39dfb Mon Sep 17 00:00:00 2001 From: Konstantinos Koukopoulos Date: Mon, 30 Sep 2013 11:50:41 +0300 Subject: [PATCH] render part upload response correctly --- moto/s3/responses.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/moto/s3/responses.py b/moto/s3/responses.py index bc359d87d..6b0cdc2d5 100644 --- a/moto/s3/responses.py +++ b/moto/s3/responses.py @@ -133,8 +133,8 @@ def _key_response(request, full_url, headers): upload_id = query['uploadId'][0] part_number = int(query['partNumber'][0]) key = s3_backend.set_part(bucket_name, upload_id, part_number, body) - - return '', dict(etag=key.etag) + template = Template(S3_MULTIPART_UPLOAD_RESPONSE) + return 200, headers, template.render(part=key) if 'x-amz-copy-source' in request.headers: # Copy key @@ -310,6 +310,12 @@ S3_MULTIPART_INITIATE_RESPONSE = """ {{ upload_id }} """ +S3_MULTIPART_UPLOAD_RESPONSE = """ + + {{ part.last_modified_ISO8601 }} + {{ part.etag }} +""" + S3_MULTIPART_COMPLETE_RESPONSE = """ http://{{ bucket_name }}.s3.amazonaws.com/{{ key_name }}