gh-105821: Use a raw f-string in test_httpservers.py (#105822)

Use a raw f-string in test_httpservers.py
This commit is contained in:
Pablo Galindo Salgado 2023-06-15 11:48:01 +01:00 committed by GitHub
parent c5111aec2b
commit 09ce8c3b48
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -442,10 +442,10 @@ def test_undecodable_filename(self):
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, rf'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, rf'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.