def test_nested_cgi_path_issue21323(self):
res = self.request('/cgi-bin/child-dir/file3.py')
- self.assertEqual((b'Hello World' + self.linesep, 'text/html', 200),
- (res.read(), res.getheader('Content-type'), res.status))
+ self.assertEqual(
+ (b'Hello World' + self.linesep, 'text/html', HTTPStatus.OK),
+ (res.read(), res.getheader('Content-type'), res.status))
+ def test_query_with_multiple_question_mark(self):
+ res = self.request('/cgi-bin/file4.py?a=b?c=d')
+ self.assertEqual(
+ (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):
Library
-------
+ - Issue #25232: Fix CGIRequestHandler to split the query from the URL at the
+ first question mark (?) rather than the last. Patch from Xiang Zhang.
+
+ - Issue #24657: Prevent CGIRequestHandler from collapsing slashes in the
+ query part of the URL as if it were a path. Patch from Xiang Zhang.
+
+- Issue #24483: C implementation of functools.lru_cache() now calculates key's
+ hash only once.
+
- Issue #22958: Constructor and update method of weakref.WeakValueDictionary
now accept the self and the dict keyword arguments.