]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Backporting to 2.3:
authorGuido van Rossum <guido@python.org>
Sat, 20 Mar 2004 22:22:31 +0000 (22:22 +0000)
committerGuido van Rossum <guido@python.org>
Sat, 20 Mar 2004 22:22:31 +0000 (22:22 +0000)
Fix for SF 777848.
I've been bitten by this myself in the past half year.
I hope this fix is right.

Lib/CGIHTTPServer.py

index 7f481b7b3cf575973948a9e213caf0018db5aa88..8545640359b3da59aad5820bec195f19439df3fb 100644 (file)
@@ -177,12 +177,11 @@ class CGIHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
         if co:
             env['HTTP_COOKIE'] = ', '.join(co)
         # XXX Other HTTP_* headers
-        if not self.have_fork:
-            # Since we're setting the env in the parent, provide empty
-            # values to override previously set values
-            for k in ('QUERY_STRING', 'REMOTE_HOST', 'CONTENT_LENGTH',
-                      'HTTP_USER_AGENT', 'HTTP_COOKIE'):
-                env.setdefault(k, "")
+        # Since we're setting the env in the parent, provide empty
+        # values to override previously set values
+        for k in ('QUERY_STRING', 'REMOTE_HOST', 'CONTENT_LENGTH',
+                  'HTTP_USER_AGENT', 'HTTP_COOKIE'):
+            env.setdefault(k, "")
         os.environ.update(env)
 
         self.send_response(200, "Script output follows")