summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-05-13 20:13:24 (GMT)
committerGuido van Rossum <guido@python.org>1998-05-13 20:13:24 (GMT)
commit01fc65d92fcf774c4b14fb0e744ad4d08c825168 (patch)
tree8bd4431bdec5e380efad8ae0d43ae8dd9719af7b
parent1f05cb007a12f018183630df6dc1e82fb472b8a3 (diff)
downloadcpython-01fc65d92fcf774c4b14fb0e744ad4d08c825168.zip
cpython-01fc65d92fcf774c4b14fb0e744ad4d08c825168.tar.gz
cpython-01fc65d92fcf774c4b14fb0e744ad4d08c825168.tar.bz2
From: conrad@cgl.ucsf.edu (Conrad Huang %CGL)
To: python-list@cwi.nl Date: 13 May 98 18:33:11 GMT I think I found a bug in CGIHTTPServer.py. (Does anyone care? :-) I was trying to use it as the web server for uploading files. Python CGI scripts (using the CGI module) that worked for other servers (e.g., Netscape Enterprise server) hang when run from CGIHTTPServer. The problem is that the content type parameters, in particular the boundary parameter, were not passed through to the CGI scripts, thus making the MIME parsing code choke. My simple-minded fix is: % diff CGIHTTPServer.py /usr/local/lib/python1.5/CGIHTTPServer.py 137,140c136 < if self.headers.typeheader is None: < env['CONTENT_TYPE'] = self.headers.type < else: < env['CONTENT_TYPE'] = self.headers.typeheader --- > env['CONTENT_TYPE'] = self.headers.type Conrad
-rw-r--r--Lib/CGIHTTPServer.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/CGIHTTPServer.py b/Lib/CGIHTTPServer.py
index bb8cb2d..24bdeef 100644
--- a/Lib/CGIHTTPServer.py
+++ b/Lib/CGIHTTPServer.py
@@ -133,7 +133,10 @@ class CGIHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
# AUTH_TYPE
# REMOTE_USER
# REMOTE_IDENT
- env['CONTENT_TYPE'] = self.headers.type
+ if self.headers.typeheader is None:
+ env['CONTENT_TYPE'] = self.headers.type
+ else:
+ env['CONTENT_TYPE'] = self.headers.typeheader
length = self.headers.getheader('content-length')
if length:
env['CONTENT_LENGTH'] = length