summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorŁukasz Langa <lukasz@langa.pl>2023-08-24 17:44:27 (GMT)
committerŁukasz Langa <lukasz@langa.pl>2023-08-24 17:44:27 (GMT)
commit92f9ce726b7c5ea79b1b1451223220a3b35fc845 (patch)
tree3b9470fa4a89520acdcd2546003567ad7fc28b0a
parentd2cd0a3acba593334fdc2c42b64885de455a9d36 (diff)
downloadcpython-92f9ce726b7c5ea79b1b1451223220a3b35fc845.zip
cpython-92f9ce726b7c5ea79b1b1451223220a3b35fc845.tar.gz
cpython-92f9ce726b7c5ea79b1b1451223220a3b35fc845.tar.bz2
Fix invalid string escape
-rw-r--r--Lib/test/test_httpservers.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_httpservers.py b/Lib/test/test_httpservers.py
index 153206d..b70a109 100644
--- a/Lib/test/test_httpservers.py
+++ b/Lib/test/test_httpservers.py
@@ -418,10 +418,10 @@ class SimpleHTTPServerTestCase(BaseTestCase):
def test_undecodable_parameter(self):
# sanity check using a valid parameter
response = self.request(self.base_url + '/?x=123').read()
- self.assertRegex(response, f'listing for {self.base_url}/\?x=123'.encode('latin1'))
+ self.assertRegex(response, f'listing for {self.base_url}/\\?x=123'.encode('latin1'))
# now the bogus encoding
response = self.request(self.base_url + '/?x=%bb').read()
- self.assertRegex(response, f'listing for {self.base_url}/\?x=\xef\xbf\xbd'.encode('latin1'))
+ self.assertRegex(response, f'listing for {self.base_url}/\\?x=\xef\xbf\xbd'.encode('latin1'))
def test_get_dir_redirect_location_domain_injection_bug(self):
"""Ensure //evil.co/..%2f../../X does not put //evil.co/ in Location.