mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
[3.11] gh-105821: Use a raw f-string in test_httpservers.py (GH-105822) (#108576)
gh-105821: Use a raw f-string in test_httpservers.py (GH-105822)
Use a raw f-string in test_httpservers.py
(cherry picked from commit 09ce8c3b48
)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
This commit is contained in:
parent
33eee4340e
commit
ed749be3aa
1 changed files with 2 additions and 2 deletions
|
@ -442,10 +442,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, 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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue