From fc8305c0fe7fcec69fe841bb004b580f60dd1e43 Mon Sep 17 00:00:00 2001 From: Mike Schwartz Date: Tue, 31 Aug 2010 16:46:55 -0700 Subject: Fixed bug in boto/s3/key.py that caused mimetypes.guess_type() to override Content-Type explicitly set in headers. --- boto/s3/key.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/boto/s3/key.py b/boto/s3/key.py index 38939e18..d00c99e7 100644 --- a/boto/s3/key.py +++ b/boto/s3/key.py @@ -458,10 +458,10 @@ class Key(object): if self.storage_class != 'STANDARD': provider = self.bucket.connection.provider headers[provider.storage_class_header] = self.storage_class - if headers.has_key('Content-Type'): - self.content_type = headers['Content-Type'] if headers.has_key('Content-Encoding'): self.content_encoding = headers['Content-Encoding'] + if headers.has_key('Content-Type'): + self.content_type = headers['Content-Type'] elif self.path: self.content_type = mimetypes.guess_type(self.path)[0] if self.content_type == None: -- cgit v1.2.1