Skip to content

Commit 398b453

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Remove use of removeprefix" into unmaintained/yoga
2 parents 71aaed2 + 6a1eb59 commit 398b453

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

nova/tests/unit/console/test_websocketproxy.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,9 @@ def test_reject_open_redirect(self, url='//example.com/%2F..'):
637637
# now the same url but with extra leading '/' characters removed.
638638
if expected_cpython in errmsg:
639639
location = result[3].decode()
640-
location = location.removeprefix('Location: ').rstrip('\r\n')
640+
if location.startswith('Location: '):
641+
location = location[len('Location: '):]
642+
location = location.rstrip('\r\n')
641643
self.assertTrue(
642644
location.startswith('/example.com/%2F..'),
643645
msg='Redirect location is not the expected sanitized URL',

0 commit comments

Comments
 (0)