Merge "Remove use of removeprefix"

This commit is contained in:
Zuul
2023-01-16 23:49:50 +00:00
committed by Gerrit Code Review
@@ -635,7 +635,9 @@ class NovaProxyRequestHandlerTestCase(test.NoDBTestCase):
# now the same url but with extra leading '/' characters removed.
if expected_cpython in errmsg:
location = result[3].decode()
location = location.removeprefix('Location: ').rstrip('\r\n')
if location.startswith('Location: '):
location = location[len('Location: '):]
location = location.rstrip('\r\n')
self.assertTrue(
location.startswith('/example.com/%2F..'),
msg='Redirect location is not the expected sanitized URL',