You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by qu...@apache.org on 2017/11/06 15:09:09 UTC

[2/5] libcloud git commit: Fix bug in Azure blob store request signing preventing delete_object() from working.

Fix bug in Azure blob store request signing preventing delete_object() from working.

Signed-off-by: Quentin Pradet <qu...@apache.org>


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

Branch: refs/heads/trunk
Commit: 152a5e0ba2175f702f44d5b63569cfc28df650a4
Parents: a0e34e3
Author: Peter Amstutz <pa...@veritasgenetics.com>
Authored: Wed Oct 18 20:15:16 2017 +0000
Committer: Quentin Pradet <qu...@apache.org>
Committed: Mon Nov 6 19:01:11 2017 +0400

----------------------------------------------------------------------
 libcloud/common/azure.py | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/152a5e0b/libcloud/common/azure.py
----------------------------------------------------------------------
diff --git a/libcloud/common/azure.py b/libcloud/common/azure.py
index 4884f32..6dc44f0 100644
--- a/libcloud/common/azure.py
+++ b/libcloud/common/azure.py
@@ -193,6 +193,10 @@ class AzureConnection(ConnectionUserAndKey):
             header = header.lower()  # Just for safety
             if header in headers_copy:
                 special_header_values.append(headers_copy[header])
+            elif header == "content-length" and method not in ("GET", "HEAD"):
+                # Must be '0' unless method is GET or HEAD
+                # https://docs.microsoft.com/en-us/rest/api/storageservices/authentication-for-the-azure-storage-services
+                special_header_values.append('0')
             else:
                 special_header_values.append('')