Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 70ec0b4

Browse files
committed
Fix for SF 777848.
I've been bitten by this myself in the past half year. I hope this fix is right. I'll backport this to 2.3.
1 parent 27f4961 commit 70ec0b4

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

Lib/CGIHTTPServer.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -177,12 +177,11 @@ def run_cgi(self):
177177
if co:
178178
env['HTTP_COOKIE'] = ', '.join(co)
179179
# XXX Other HTTP_* headers
180-
if not self.have_fork:
181-
# Since we're setting the env in the parent, provide empty
182-
# values to override previously set values
183-
for k in ('QUERY_STRING', 'REMOTE_HOST', 'CONTENT_LENGTH',
184-
'HTTP_USER_AGENT', 'HTTP_COOKIE'):
185-
env.setdefault(k, "")
180+
# Since we're setting the env in the parent, provide empty
181+
# values to override previously set values
182+
for k in ('QUERY_STRING', 'REMOTE_HOST', 'CONTENT_LENGTH',
183+
'HTTP_USER_AGENT', 'HTTP_COOKIE'):
184+
env.setdefault(k, "")
186185
os.environ.update(env)
187186

188187
self.send_response(200, "Script output follows")

0 commit comments

Comments
 (0)