mirror of
https://github.com/python/cpython.git
synced 2025-10-09 08:31:26 +00:00
SF 563203. Replaced 'has_key()' with 'in'.
This commit is contained in:
parent
9d5e4aa414
commit
54f0222547
54 changed files with 243 additions and 222 deletions
|
@ -549,7 +549,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 (headers.has_key('Host')
|
||||
if 'Host' in (headers
|
||||
or [k for k in headers.iterkeys() if k.lower() == "host"]):
|
||||
self.putrequest(method, url, skip_host=1)
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue