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 | cb29e8c0e5dc67c5f73926ea0c540612ca40714a (patch) | |
tree | a687804c0989d3a5d108daaa1550a6fa1aff3c48 /Lib/test | |
parent | a02e18a43f61543c911c82698d3cf44c8c11a0c2 (diff) | |
download | cpython-cb29e8c0e5dc67c5f73926ea0c540612ca40714a.zip cpython-cb29e8c0e5dc67c5f73926ea0c540612ca40714a.tar.gz cpython-cb29e8c0e5dc67c5f73926ea0c540612ca40714a.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')
-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 d50a9ac..6e5f2db 100644 --- a/Lib/test/test_httpservers.py +++ b/Lib/test/test_httpservers.py @@ -565,6 +565,13 @@ class CGIHTTPServerTestCase(BaseTestCase): (b'a=b?c=d' + self.linesep, '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//' + self.linesep, + 'text/html', 200), + (res.read(), res.getheader('Content-type'), res.status)) + class SocketlessRequestHandler(SimpleHTTPRequestHandler): def __init__(self): |