Skip to content

Commit 612225d

Browse files
stephenfinjovial
authored andcommitted
Remove use of removeprefix
This is not supported on Python 3.8 [1]. I have no idea why this was not failing CI. [1] https://docs.python.org/3.9/library/stdtypes.html#str.removeprefix Change-Id: I225e9ced0f75c415b1d2fee05440291e3d8635c0 Signed-off-by: Stephen Finucane <[email protected]> (cherry picked from commit 3ccf82e) (cherry picked from commit 2d011ac32c132fa5c4d03f8167c2be3648d5d123)
1 parent de928ad commit 612225d

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)