Skip to content
This repository has been archived by the owner on Jun 27, 2018. It is now read-only.

Commit

Permalink
Merge branch 'develop' of github.com:boto/boto into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
garnaat committed Jun 14, 2012
2 parents 9fabfca + d774b12 commit 6a501a4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions boto/s3/bucket.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ def get_key(self, key_name, headers=None, version_id=None, response_headers=None
k.content_type = response.getheader('content-type')
k.content_encoding = response.getheader('content-encoding')
k.content_disposition = response.getheader('content-disposition')
k.content_language = response.getheader('content-language')
k.last_modified = response.getheader('last-modified')
# the following machinations are a workaround to the fact that
# apache/fastcgi omits the content-length header on HEAD
Expand Down
5 changes: 5 additions & 0 deletions boto/s3/key.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def __init__(self, bucket=None, name=None):
self.content_type = self.DefaultContentType
self.content_encoding = None
self.content_disposition = None
self.content_language = None
self.filename = None
self.etag = None
self.is_latest = False
Expand Down Expand Up @@ -187,6 +188,8 @@ def open_read(self, headers=None, query_args='',
self.content_type = value
elif name.lower() == 'content-encoding':
self.content_encoding = value
elif name.lower() == 'content-language':
self.content_language = value
elif name.lower() == 'last-modified':
self.last_modified = value
elif name.lower() == 'cache-control':
Expand Down Expand Up @@ -686,6 +689,8 @@ def sender(http_conn, method, path, data, headers):
headers[provider.storage_class_header] = self.storage_class
if 'Content-Encoding' in headers:
self.content_encoding = headers['Content-Encoding']
if 'Content-Language' in headers:
self.content_encoding = headers['Content-Language']
if 'Content-Type' in headers:
# Some use cases need to suppress sending of the Content-Type
# header and depend on the receiving server to set the content
Expand Down
3 changes: 3 additions & 0 deletions tests/integration/s3/mock_storage_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def __init__(self, bucket=None, name=None):
self.etag = None
self.size = None
self.content_encoding = None
self.content_language = None
self.content_type = None
self.last_modified = 'Wed, 06 Oct 2010 05:11:54 GMT'
self.BufferSize = 8192
Expand Down Expand Up @@ -100,6 +101,8 @@ def _handle_headers(self, headers):
self.content_encoding = headers['Content-Encoding']
if 'Content-Type' in headers:
self.content_type = headers['Content-Type']
if 'Content-Language' in headers:
self.content_language = headers['Content-Language']

def open_read(self, headers=NOT_IMPL, query_args=NOT_IMPL,
override_num_retries=NOT_IMPL):
Expand Down

0 comments on commit 6a501a4

Please sign in to comment.