commando: limit total request size.

1MB normally, but 10MB if you have a cached rune.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2022-04-06 13:49:52 +09:30
parent 36080d6771
commit 3db50f4796
2 changed files with 31 additions and 1 deletions

View File

@@ -316,3 +316,10 @@ def test_megacmd(node_factory):
'method': 'get' + 'x' * 130000,
'rune': rrune,
'params': {}})
with pytest.raises(RpcError, match='Command too long'):
l1.rpc.call(method='commando',
payload={'peer_id': l2.info['id'],
'method': 'get' + 'x' * 1100000,
'rune': rrune,
'params': {}})