Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Seems like specifically looking for the value None would be both more…
Browse files Browse the repository at this point in the history
… explicit and more accurate with respect to the documentation.
  • Loading branch information
mco-gh committed Feb 27, 2012
1 parent 33fb4d2 commit 28208bf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion boto/gs/resumable_upload_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions boto/s3/key.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 28208bf

Please sign in to comment.