Permalink
Browse files

Seems like specifically looking for the value None would be both more…

… explicit and more accurate with respect to the documentation.
  • Loading branch information...
1 parent 33fb4d2 commit 28208bfc28d118a8249574d68c482e9a9fe97e65 @marcacohen marcacohen committed Feb 27, 2012
Showing with 4 additions and 4 deletions.
  1. +1 −1 boto/gs/resumable_upload_handler.py
  2. +3 −3 boto/s3/key.py
View
2 boto/gs/resumable_upload_handler.py
@@ -512,7 +512,7 @@ def send_file(self, key, fp, headers, cb=None, num_cb=10):
# This is gsutil's way of asking boto to refrain from auto-generating
# that header.
CT = 'Content-Type'
- if CT in headers and not headers[CT]:
+ if CT in headers and headers[CT] is None:
del headers[CT]
fp.seek(0, os.SEEK_END)
View
6 boto/s3/key.py
@@ -573,11 +573,11 @@ def sender(http_conn, method, path, data, headers):
# header and depend on the receiving server to set the content
# type. This can be achieved by setting headers['Content-Type']
# to None when calling this method.
- if headers['Content-Type']:
- self.content_type = headers['Content-Type']
- else:
+ if headers['Content-Type'] is None:
# Delete null Content-Type value to skip sending that header.
del headers['Content-Type']
+ else:
+ self.content_type = headers['Content-Type']
elif self.path:
self.content_type = mimetypes.guess_type(self.path)[0]
if self.content_type == None:

0 comments on commit 28208bf

Please sign in to comment.