Skip to content

Commit

Permalink
[3.12] gh-105821: Use a raw f-string in test_httpservers.py (GH-105822)…
Browse files Browse the repository at this point in the history
… (#105824)

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 09ce8c3)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
  • Loading branch information
miss-islington and pablogsal authored Jun 15, 2023
1 parent 9012c55 commit 3073e23
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Lib/test/test_httpservers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 3073e23

Please sign in to comment.