diff options
author | Martin Panter <vadmium+py@gmail.com> | 2015-10-03 05:55:46 (GMT) |
---|---|---|
committer | Martin Panter <vadmium+py@gmail.com> | 2015-10-03 05:55:46 (GMT) |
commit | 74c76c8f06c60698a23289abc48d23b9b4ea6c27 (patch) | |
tree | 23a8ea1653ac189f20db2792aa49142541d290f1 /Lib/test/test_httpservers.py | |
parent | cff22eb2bfde08b000c476e121eef551a5e3af6c (diff) | |
download | cpython-74c76c8f06c60698a23289abc48d23b9b4ea6c27.zip cpython-74c76c8f06c60698a23289abc48d23b9b4ea6c27.tar.gz cpython-74c76c8f06c60698a23289abc48d23b9b4ea6c27.tar.bz2 |
Issue #24657: Prevent CGIRequestHandler from collapsing the URL query
Initial patch from Xiang Zhang. Also fix out-of-date _url_collapse_path() doc
string.
Diffstat (limited to 'Lib/test/test_httpservers.py')
-rw-r--r-- | Lib/test/test_httpservers.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_httpservers.py b/Lib/test/test_httpservers.py index 023180e..c84f48f 100644 --- a/Lib/test/test_httpservers.py +++ b/Lib/test/test_httpservers.py @@ -558,6 +558,13 @@ class CGIHTTPServerTestCase(BaseTestCase): (b'a=b?c=d\n', 'text/html', 200), (res.read(), res.getheader('Content-type'), res.status)) + def test_query_with_continuous_slashes(self): + res = self.request('/cgi-bin/file4.py?k=aa%2F%2Fbb&//q//p//=//a//b//') + self.assertEqual( + (b'k=aa%2F%2Fbb&//q//p//=//a//b//\n', + 'text/html', 200), + (res.read(), res.getheader('Content-type'), res.status)) + class SimpleHTTPRequestHandlerTestCase(unittest.TestCase): """ Test url parsing """ |