From cc175183905ca31151785d71b33e27358239aff1 Mon Sep 17 00:00:00 2001 From: Bob Thompson Date: Tue, 16 Jul 2013 13:37:33 -0400 Subject: [PATCH] Issue LIBCLOUD-362: Fixed GoGrid Content-Length bug. --- libcloud/common/base.py | 2 +- libcloud/common/gogrid.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/libcloud/common/base.py b/libcloud/common/base.py index 21eef2b..95a008d 100644 --- a/libcloud/common/base.py +++ b/libcloud/common/base.py @@ -572,7 +572,7 @@ class Connection(object): headers.update({'Host': self.host}) # Encode data if necessary - if data: + if data is not None: data = self.encode_data(data) headers.update({'Content-Length': str(len(data))}) diff --git a/libcloud/common/gogrid.py b/libcloud/common/gogrid.py index a56ba3b..174e6c4 100644 --- a/libcloud/common/gogrid.py +++ b/libcloud/common/gogrid.py @@ -82,6 +82,9 @@ class GoGridConnection(ConnectionUserAndKey): m = hashlib.md5(b(key + secret + str(int(time.time())))) return m.hexdigest() + def request(self, action, params=None, data='', headers=None, method='GET', raw=False): + return super(GoGridConnection, self).request(action, params, data, headers, method, raw) + class GoGridIpAddress(object): """ -- 1.8.1.msysgit.1