Skip to content

Commit 0a728e7

Browse files
committed
Fix invalid string escape
1 parent a56dcae commit 0a728e7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Lib/test/test_httpservers.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -417,10 +417,10 @@ def test_undecodable_filename(self):
417417
def test_undecodable_parameter(self):
418418
# sanity check using a valid parameter
419419
response = self.request(self.base_url + '/?x=123').read()
420-
self.assertRegex(response, f'listing for {self.base_url}/\?x=123'.encode('latin1'))
420+
self.assertRegex(response, f'listing for {self.base_url}/\\?x=123'.encode('latin1'))
421421
# now the bogus encoding
422422
response = self.request(self.base_url + '/?x=%bb').read()
423-
self.assertRegex(response, f'listing for {self.base_url}/\?x=\xef\xbf\xbd'.encode('latin1'))
423+
self.assertRegex(response, f'listing for {self.base_url}/\\?x=\xef\xbf\xbd'.encode('latin1'))
424424

425425
def test_get_dir_redirect_location_domain_injection_bug(self):
426426
"""Ensure //evil.co/..%2f../../X does not put //evil.co/ in Location.

0 commit comments

Comments
 (0)