Merge "Fix another way mw may encouter invalid swift paths"

This commit is contained in:
Zuul
2025年08月07日 00:06:31 +00:00
committed by Gerrit Code Review

View File

@@ -1223,6 +1223,18 @@ class TestDecrypter(unittest.TestCase):
resp = req.get_response(app)
self.assertEqual(resp.status_int, 404)
def test_invalid_swift_path(self):
path = '/v1/\xC0.\xC0./\xC0.\xC0./\xC0.\xC0./\xC0.\xC0./winnt/win.ini'
fake_swift = FakeSwift()
fake_swift.register('GET', path, HTTPNotFound, {})
app = keymaster.KeyMaster(decrypter.Decrypter(fake_swift, {}), {
'encryption_root_secret': 'A' * 80,
})
app.app.logger = debug_logger()
req = Request.blank(path)
resp = req.get_response(app)
self.assertEqual(resp.status_int, 404)
if __name__ == '__main__':
unittest.main()
Reference in New Issue
openstack/swift
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.

The note is not visible to the blocked user.