summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_httpservers.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2014-12-26 16:53:43 (GMT)
committerBenjamin Peterson <benjamin@python.org>2014-12-26 16:53:43 (GMT)
commita71cfc5cf3e32b694be754ff476ce0181a7319a2 (patch)
treef827ba52996a8f80b0f25eab25a3f74d542d0ed4 /Lib/test/test_httpservers.py
parentcb36d247a731e2d1c041cf662966f4f3bacadac9 (diff)
downloadcpython-a71cfc5cf3e32b694be754ff476ce0181a7319a2.zip
cpython-a71cfc5cf3e32b694be754ff476ce0181a7319a2.tar.gz
cpython-a71cfc5cf3e32b694be754ff476ce0181a7319a2.tar.bz2
fix behavior of trailing slash redirection when a query string is involved (closes #23112)
Diffstat (limited to 'Lib/test/test_httpservers.py')
-rw-r--r--Lib/test/test_httpservers.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_httpservers.py b/Lib/test/test_httpservers.py
index bd26140..706dfc7 100644
--- a/Lib/test/test_httpservers.py
+++ b/Lib/test/test_httpservers.py
@@ -321,6 +321,12 @@ class SimpleHTTPServerTestCase(BaseTestCase):
self.check_status_and_reason(response, 200)
response = self.request(self.tempdir_name)
self.check_status_and_reason(response, 301)
+ response = self.request(self.tempdir_name + '/?hi=2')
+ self.check_status_and_reason(response, 200)
+ response = self.request(self.tempdir_name + '?hi=1')
+ self.check_status_and_reason(response, 301)
+ self.assertEqual(response.getheader("Location"),
+ self.tempdir_name + "/?hi=1")
response = self.request('/ThisDoesNotExist')
self.check_status_and_reason(response, 404)
response = self.request('/' + 'ThisDoesNotExist' + '/')