[3.10] gh-105821: Use a raw f-string in test_httpservers.py (GH-105822) (#115519)

This commit is contained in:
Miss Islington (bot) 2024-02-16 02:06:00 +01:00 committed by GitHub
parent 0e7ff84038
commit 6091fbda8b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -420,10 +420,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.