mirror of
https://github.com/python/cpython.git
synced 2026-05-03 00:58:30 +00:00
Fix Issue9272 - Change CGIHTTPServer to give the child program a copy of os.environ
This commit is contained in:
parent
388f956c35
commit
4271372a71
2 changed files with 13 additions and 4 deletions
|
|
@ -402,6 +402,14 @@ def test_no_leading_slash(self):
|
|||
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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue