Commit 7509c45c authored by Alex Martelli's avatar Alex Martelli

fixed obvious bug in _send_header as per SF bug #831271

(same as commit of Sun Nov 2 to the release23-maint branch)
parent a6b3fb28
......@@ -727,8 +727,7 @@ class HTTPConnection:
# If headers already contains a host header, then define the
# optional skip_host argument to putrequest(). The check is
# harder because field names are case insensitive.
if 'Host' in (headers
or [k for k in headers.iterkeys() if k.lower() == "host"]):
if 'host' in [k.lower() for k in headers]:
self.putrequest(method, url, skip_host=1)
else:
self.putrequest(method, url)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment