Skip to content

Commit 92f9ce7

Browse files
committed
Fix invalid string escape
1 parent d2cd0a3 commit 92f9ce7

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
@@ -418,10 +418,10 @@ def test_undecodable_filename(self):
418418
def test_undecodable_parameter(self):
419419
# sanity check using a valid parameter
420420
response = self.request(self.base_url + '/?x=123').read()
421-
self.assertRegex(response, f'listing for {self.base_url}/\?x=123'.encode('latin1'))
421+
self.assertRegex(response, f'listing for {self.base_url}/\\?x=123'.encode('latin1'))
422422
# now the bogus encoding
423423
response = self.request(self.base_url + '/?x=%bb').read()
424-
self.assertRegex(response, f'listing for {self.base_url}/\?x=\xef\xbf\xbd'.encode('latin1'))
424+
self.assertRegex(response, f'listing for {self.base_url}/\\?x=\xef\xbf\xbd'.encode('latin1'))
425425

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

0 commit comments

Comments
 (0)