diff options
author | Barry Warsaw <barry@python.org> | 2008-06-12 04:06:45 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2008-06-12 04:06:45 (GMT) |
commit | 820c1200597606f95bb996586be88a3283c6448c (patch) | |
tree | 1b914ab96ccc9cd81465a6c3e765c97f128fd464 /Lib/wsgiref | |
parent | 75f25f2c9a4646746efbc056b4d2a07b40f93964 (diff) | |
download | cpython-820c1200597606f95bb996586be88a3283c6448c.zip cpython-820c1200597606f95bb996586be88a3283c6448c.tar.gz cpython-820c1200597606f95bb996586be88a3283c6448c.tar.bz2 |
Patch for issue 2848, mostly by Humberto Diogenes, with a couple of
small fixes by Barry. This removes mimetools from the stdlib.
Diffstat (limited to 'Lib/wsgiref')
-rw-r--r-- | Lib/wsgiref/simple_server.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/wsgiref/simple_server.py b/Lib/wsgiref/simple_server.py index e74f576..44a91fa 100644 --- a/Lib/wsgiref/simple_server.py +++ b/Lib/wsgiref/simple_server.py @@ -101,16 +101,16 @@ class WSGIRequestHandler(BaseHTTPRequestHandler): env['REMOTE_HOST'] = host env['REMOTE_ADDR'] = self.client_address[0] - if self.headers.typeheader is None: - env['CONTENT_TYPE'] = self.headers.type + if self.headers.get('content-type') is None: + env['CONTENT_TYPE'] = self.headers.get_content_type() else: - env['CONTENT_TYPE'] = self.headers.typeheader + env['CONTENT_TYPE'] = self.headers['content-type'] - length = self.headers.getheader('content-length') + length = self.headers.get('content-length') if length: env['CONTENT_LENGTH'] = length - for h in self.headers.headers: + for h in self.headers: k,v = h.split(':',1) k=k.replace('-','_').upper(); v=v.strip() if k in env: |