More information about RGW is available here:
http://ceph.newdream.net/wiki/RADOS_Gateway
We are using Apache with fastcgi to serve our HTTP requests. Unfortunately,
Apache omits content-length on HTTP HEAD responses when content-length is 0.
This patch allows libboto to handle this gracefully.
For more details about Apache and Content-Length, see:
http://perl.apache.org/docs/2.0/user/handlers/http.html#C_Content_Length__Response_Header
Signed-off-by: Colin McCabe <colin....@dreamhost.com>
---
boto/s3/bucket.py | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/boto/s3/bucket.py b/boto/s3/bucket.py
index d56e4cc..0abff64 100644
--- a/boto/s3/bucket.py
+++ b/boto/s3/bucket.py
@@ -175,7 +175,11 @@ class Bucket(object):
k.content_type = response.getheader('content-type')
k.content_encoding = response.getheader('content-encoding')
k.last_modified = response.getheader('last-modified')
- k.size = int(response.getheader('content-length'))
+ clen = response.getheader('content-length')
+ if (clen):
+ k.size = int(clen)
+ else:
+ k.size = 0
k.cache_control = response.getheader('cache-control')
k.name = key_name
k.handle_version_headers(response)
--
1.7.2.3
Colin