]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
fixed obvious bug in _send_header as per SF bug #831271
authorAlex Martelli <aleaxit@gmail.com>
Sun, 2 Nov 2003 16:51:38 +0000 (16:51 +0000)
committerAlex Martelli <aleaxit@gmail.com>
Sun, 2 Nov 2003 16:51:38 +0000 (16:51 +0000)
Lib/httplib.py

index 9832e474f834cc66ab6e62eb95b70f62e0b767f9..40fad26c874cd5f8bac0e63d834f4d03885095fc 100644 (file)
@@ -726,9 +726,8 @@ class HTTPConnection:
     def _send_request(self, method, url, body, headers):
         # 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"]):
+        # more delicate because field names are case insensitive.
+        if 'host' in [k.lower() for k in headers]:
             self.putrequest(method, url, skip_host=1)
         else:
             self.putrequest(method, url)