Do not add automatically host / accept-encoding header Due to headers dictionary always have host / accept-encoding value, when perform 'raw' request, host / accept-encoding header would be duplicated. If you use AWSRequestSignerAlgorithmV4, this occurs invalid payload hash.
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/4bff0f07 Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/4bff0f07 Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/4bff0f07 Branch: refs/heads/trunk Commit: 4bff0f076776e6d59945381c1e2969826131fc11 Parents: 0e4e0ad Author: Geunwoo Shin <[email protected]> Authored: Wed Jan 27 19:47:12 2016 +0900 Committer: anthony-shaw <[email protected]> Committed: Tue Feb 9 15:12:48 2016 +1100 ---------------------------------------------------------------------- libcloud/common/base.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/libcloud/blob/4bff0f07/libcloud/common/base.py ---------------------------------------------------------------------- diff --git a/libcloud/common/base.py b/libcloud/common/base.py index 177798d..0bb26c0 100644 --- a/libcloud/common/base.py +++ b/libcloud/common/base.py @@ -798,7 +798,9 @@ class Connection(object): # @TODO: Should we just pass File object as body to request method # instead of dealing with splitting and sending the file ourselves? if raw: - self.connection.putrequest(method, url) + self.connection.putrequest(method, url, + skip_host=1, + skip_accept_encoding=1) for key, value in list(headers.items()): self.connection.putheader(key, str(value))
