fix(api): refuse deeply nested cache payloads by depth, not RecursionError

This commit is contained in:
imSp4rky
2026-11-23 17:50:50 -07:00
parent 530f78ecf5
commit c818ec3bbe
2 changed files with 10 additions and 5 deletions
@@ -38,6 +38,7 @@ def test_plain_json_is_safe(text) -> None:
'{"py/object": "datetime.datetime", "__reduce__": [{"py/type": "collections.OrderedDict"}, []]}',
'{"py/object": "datetime.datetime", "py/state": {}}',
pytest.param("[" * 100000 + "]" * 100000, id="deep-nesting"),
pytest.param("[" * 200 + "]" * 200, id="over-depth-limit"),
],
)
def test_unsafe_payload_is_refused(text) -> None: