diff options
author | NavaL <mnandri@thoughtworks.com> | 2015-12-21 10:44:37 +0100 |
---|---|---|
committer | NavaL <mnandri@thoughtworks.com> | 2015-12-21 11:00:14 +0100 |
commit | 651568ff85bde4aa152ba18eed8b587f4f2f3cab (patch) | |
tree | 732b92a3de4bf74ac710d314b7e622a60f94b04e /service/pixelated | |
parent | 4e7679766932e3d29914607f0db64ef8613b22b7 (diff) |
added filename and size to the attachment endpoint post response
Issue #548
Diffstat (limited to 'service/pixelated')
-rw-r--r-- | service/pixelated/resources/attachments_resource.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/service/pixelated/resources/attachments_resource.py b/service/pixelated/resources/attachments_resource.py index 05bc923f..19b5d0bc 100644 --- a/service/pixelated/resources/attachments_resource.py +++ b/service/pixelated/resources/attachments_resource.py @@ -94,7 +94,11 @@ class AttachmentsResource(Resource): def send_location(attachment_id): request.headers['Location'] = '/%s/%s' % (self.BASE_URL, attachment_id) - respond_json_deferred({"attachment_id": attachment_id}, request, status_code=201) + response_json = {"attachment_id": attachment_id, + "content-type": _file.type, + "filename": _file.filename, + "filesize": len(_file.value)} + respond_json_deferred(response_json, request, status_code=201) def error_handler(error): print error |