Merge "Fix another way mw may encouter invalid swift paths"
This commit is contained in:
2 changed files with 19 additions and 2 deletions
@@ -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
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.