Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
A more defensive assert within the test.
  • Loading branch information
gpshead committed Jun 15, 2022
commit 3b38f5299c311745e2a5768989f7ab67b5d50a25
4 changes: 2 additions & 2 deletions Lib/test/test_httpservers.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,8 +434,8 @@ def test_get_dir_redirect_location_domain_injection_bug(self):
self.check_status_and_reason(response, HTTPStatus.MOVED_PERMANENTLY)
location = response.getheader('Location')
self.assertFalse(location.startswith('//'), msg=location)
self.assertEqual(location, attack_url[1:] + '/',
msg='Expected Location: to start with a single / and '
self.assertEqual(location, f'/{attack_url.lstrip("/")}/',
msg='Expected Location header to start with a single / and '
Comment thread
gpshead marked this conversation as resolved.
'end with a / as this is a directory redirect.')
Comment thread
gpshead marked this conversation as resolved.

def test_get(self):
Expand Down