diff options
author | Senthil Kumaran <orsenthil@gmail.com> | 2010-10-03 17:55:45 (GMT) |
---|---|---|
committer | Senthil Kumaran <orsenthil@gmail.com> | 2010-10-03 17:55:45 (GMT) |
commit | 4271372a7145fe4a8e44982e5b89c3c7e3637c8e (patch) | |
tree | eeaa60b3b19d3c402220f3f7609bff6c860d9c87 /Lib/test/test_httpservers.py | |
parent | 388f956c35d335446c4715c8f2c28631f3c54ab1 (diff) | |
download | cpython-4271372a7145fe4a8e44982e5b89c3c7e3637c8e.zip cpython-4271372a7145fe4a8e44982e5b89c3c7e3637c8e.tar.gz cpython-4271372a7145fe4a8e44982e5b89c3c7e3637c8e.tar.bz2 |
Fix Issue9272 - Change CGIHTTPServer to give the child program a copy of os.environ
Diffstat (limited to 'Lib/test/test_httpservers.py')
-rw-r--r-- | Lib/test/test_httpservers.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_httpservers.py b/Lib/test/test_httpservers.py index 23fc7e4..08f707f 100644 --- a/Lib/test/test_httpservers.py +++ b/Lib/test/test_httpservers.py @@ -402,6 +402,14 @@ class CGIHTTPServerTestCase(BaseTestCase): self.assertEqual((b'Hello World\n', 'text/html', 200), (res.read(), res.getheader('Content-type'), res.status)) + def test_os_environ_is_not_altered(self): + signature = "Test CGI Server" + os.environ['SERVER_SOFTWARE'] = signature + res = self.request('/cgi-bin/file1.py') + self.assertEqual((b'Hello World\n', 'text/html', 200), + (res.read(), res.getheader('Content-type'), res.status)) + self.assertEqual(os.environ['SERVER_SOFTWARE'], signature) + class SocketlessRequestHandler(SimpleHTTPRequestHandler): def __init__(self): |