summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Romer <tedromer@google.com>2013-09-16 10:40:57 -0700
committerTed Romer <tedromer@google.com>2013-09-16 10:40:57 -0700
commit2a545f706468d6eda989a8ccc973e88e62a0d803 (patch)
treea8ef5e3cbc7c73ba278ca4330993ed492e4e8bf3
parentef8f7c3c072b69f93fa73b10740779c542c99707 (diff)
downloadboto-2a545f706468d6eda989a8ccc973e88e62a0d803.tar.gz
.
-rw-r--r--boto/connection.py3
-rw-r--r--boto/s3/key.py5
2 files changed, 4 insertions, 4 deletions
diff --git a/boto/connection.py b/boto/connection.py
index f2bac969..950a8fe7 100644
--- a/boto/connection.py
+++ b/boto/connection.py
@@ -945,7 +945,8 @@ class AWSAuthConnection(object):
headers = {}
else:
headers = headers.copy()
- if not 'host' in headers and self.host_header:
+ if (self.host_header and
+ not boto.utils.find_matching_headers('host', headers)):
headers['host'] = self.host_header
host = host or self.host
if self.use_proxy:
diff --git a/boto/s3/key.py b/boto/s3/key.py
index 01bcafc9..2b7ae73a 100644
--- a/boto/s3/key.py
+++ b/boto/s3/key.py
@@ -752,11 +752,10 @@ class Key(object):
# If the caller explicitly specified host header, tell putrequest
# not to add a second host header. Similarly for accept-encoding.
- header_names = dict.fromkeys([k.lower() for k in headers])
skips = {}
- if 'host' in header_names:
+ if boto.utils.find_matching_headers('host', headers):
skips['skip_host'] = 1
- if 'accept-encoding' in header_names:
+ if boto.utils.find_matching_headers('accept-encoding', headers):
skips['skip_accept_encoding'] = 1
http_conn.putrequest(method, path, **skips)
for key in headers: