diff options
Diffstat (limited to 'nova/tests/unit/console/test_websocketproxy.py')
-rw-r--r-- | nova/tests/unit/console/test_websocketproxy.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/nova/tests/unit/console/test_websocketproxy.py b/nova/tests/unit/console/test_websocketproxy.py index fc25bef2bc..639623bbb5 100644 --- a/nova/tests/unit/console/test_websocketproxy.py +++ b/nova/tests/unit/console/test_websocketproxy.py @@ -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', |