Repository: libcloud
Updated Branches:
  refs/heads/trunk 59b44a0d1 -> a594266de


Fix Azure blobs driver, make sure Content-Length header value is a
string and not a number.

Part of LIBCLOUD-945

Closes #1111


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

Branch: refs/heads/trunk
Commit: 28a5590425aefc2983d40b71b4372e3340ceeecf
Parents: 59b44a0
Author: Tomaz Muraus <[email protected]>
Authored: Tue Sep 19 17:27:27 2017 +0200
Committer: Tomaz Muraus <[email protected]>
Committed: Tue Sep 19 21:00:02 2017 +0200

----------------------------------------------------------------------
 libcloud/storage/drivers/azure_blobs.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/28a55904/libcloud/storage/drivers/azure_blobs.py
----------------------------------------------------------------------
diff --git a/libcloud/storage/drivers/azure_blobs.py 
b/libcloud/storage/drivers/azure_blobs.py
index e1bb722..82ee03a 100644
--- a/libcloud/storage/drivers/azure_blobs.py
+++ b/libcloud/storage/drivers/azure_blobs.py
@@ -634,7 +634,7 @@ class AzureBlobsStorageDriver(StorageDriver):
             chunk_hash = base64.b64encode(b(chunk_hash.digest()))
 
             headers['Content-MD5'] = chunk_hash.decode('utf-8')
-            headers['Content-Length'] = content_length
+            headers['Content-Length'] = str(content_length)
 
             if blob_type == 'BlockBlob':
                 # Block id can be any unique string that is base64 encoded
@@ -861,10 +861,10 @@ class AzureBlobsStorageDriver(StorageDriver):
         self._update_metadata(headers, meta_data)
 
         if object_size is not None:
-            headers['Content-Length'] = object_size
+            headers['Content-Length'] = str(object_size)
 
         if blob_type == 'PageBlob':
-            headers['Content-Length'] = 0
+            headers['Content-Length'] = str('0')
             headers['x-ms-blob-content-length'] = object_size
 
         return headers

Reply via email to