[Zope-Checkins] CVS: Zope3/lib/python/Zope/Server/HTTP - HTTPTask.py:1.1.4.2
Jim Fulton
jim@zope.com
Mon, 10 Jun 2002 15:34:58 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/Server/HTTP
In directory cvs.zope.org:/tmp/cvs-serv5490/lib/python/Zope/Server/HTTP
Modified Files:
Tag: Zope-3x-branch
HTTPTask.py
Log Message:
Implemented
http://dev.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/IContainerPythonification
Along the way:
- Converted most uses of has_key to use in.
- Fixed a bug in Interface names and namesAndDescriptions methods
that caused base class attributes to be missed.
=== Zope3/lib/python/Zope/Server/HTTP/HTTPTask.py 1.1.4.1 => 1.1.4.2 ===
if version == '1.0':
if connection == 'keep-alive':
- if not response_headers.has_key('Content-Length'):
+ if not ('Content-Length' in response_headers):
close_it = 1
else:
response_headers['Connection'] = 'Keep-Alive'
@@ -136,13 +136,13 @@
elif version == '1.1':
if connection == 'close':
close_it = 1
- elif response_headers.has_key ('Transfer-Encoding'):
+ elif 'Transfer-Encoding' in response_headers:
if not response_headers['Transfer-Encoding'] == 'chunked':
close_it = 1
elif self.status == '304':
# Replying with headers only.
pass
- elif not response_headers.has_key ('Content-Length'):
+ elif not ('Content-Length' in response_headers):
close_it = 1
else:
# Close if unrecognized HTTP version.
@@ -199,7 +199,7 @@
resolver = getattr(server, 'resolver', None)
if resolver is not None:
dns_cache = resolver.cache
- if dns_cache.has_key(addr):
+ if addr in dns_cache:
remote_host = dns_cache[addr][2]
if remote_host is not None:
env['REMOTE_HOST'] = remote_host