libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject git commit: LIBCLOUD-430: Implement support for content-disposition header in the CloudFiles driver.
Date Mon, 02 Dec 2013 12:00:31 GMT
Updated Branches:
  refs/heads/trunk 5d310f196 -> 7b3fd341a


LIBCLOUD-430: Implement support for content-disposition header in the CloudFiles driver.

Signed-off-by: Tomaz Muraus <tomaz@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/7b3fd341
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/7b3fd341
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/7b3fd341

Branch: refs/heads/trunk
Commit: 7b3fd341a5dcf5ce2d313e8a20ec7b9177f5c727
Parents: 5d310f1
Author: Michael Farrell <micolous+git@gmail.com>
Authored: Mon Dec 2 16:58:28 2013 +1030
Committer: Tomaz Muraus <tomaz@apache.org>
Committed: Mon Dec 2 12:19:42 2013 +0100

----------------------------------------------------------------------
 libcloud/storage/drivers/cloudfiles.py | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/7b3fd341/libcloud/storage/drivers/cloudfiles.py
----------------------------------------------------------------------
diff --git a/libcloud/storage/drivers/cloudfiles.py b/libcloud/storage/drivers/cloudfiles.py
index b34be48..aeaba57 100644
--- a/libcloud/storage/drivers/cloudfiles.py
+++ b/libcloud/storage/drivers/cloudfiles.py
@@ -697,6 +697,7 @@ class CloudFilesStorageDriver(StorageDriver, OpenStackDriverMixin):
         object_name_encoded = self._encode_object_name(object_name)
         content_type = extra.get('content_type', None)
         meta_data = extra.get('meta_data', None)
+        content_disposition = extra.get('content_disposition', None)
 
         headers = {}
         if meta_data:
@@ -704,6 +705,9 @@ class CloudFilesStorageDriver(StorageDriver, OpenStackDriverMixin):
                 key = 'X-Object-Meta-%s' % (key)
                 headers[key] = value
 
+        if content_disposition is not None:
+            headers['Content-Disposition'] = content_disposition
+
         request_path = '/%s/%s' % (container_name_encoded, object_name_encoded)
         result_dict = self._upload_object(
             object_name=object_name, content_type=content_type,


Mime
View raw message