Skip to content

0.158.2: refuse a non-finite number or a body nested past 200 before sending - #77

Merged
tmoosting merged 1 commit into
mainfrom
body-refusals
Nov 27, 2026
Merged

tmoosting merged 1 commit into
mainfrom
body-refusals

Conversation

@tmoosting

Copy link
Copy Markdown
Member

json.dumps wrote the bare tokens NaN, Infinity and -Infinity, which are not JSON, and the server answered them with a 500. Any request body holding one now raises a ValueError naming the value and its place, nothing is sent, and the body is encoded with allow_nan=False after. A body nested more than 200 deep (counted as the folder readers count it) is refused the same way, by a walk with its own stack. Watched failing on 0.158.1; three plants, each red alone; the staging write checks pass. The npm SDK refuses both in the same words (4.219.2): 3,000 random bodies through both, every refusal word for word the same.

🤖 Generated with Claude Code

…used before sending

json.dumps wrote the bare tokens NaN, Infinity and -Infinity, which are not
JSON, and the server answered them with a 500. Any request body holding one now
raises a ValueError that names the value and its place; nothing is sent, and the
body is encoded with allow_nan=False after. A body nested more than 200 deep,
counted as the folder readers count it, is refused the same way, by a walk with
its own stack. A body with both is refused for its depth. The npm SDK refuses
both in the same words (4.219.2). Watched failing on 0.158.1: each body was sent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tmoosting
tmoosting merged commit 5946b0f into main Nov 27, 2026
11 checks passed

This branch was previously deployed

1 inactive deployment
pypi — 5946b0f1 Deployed Nov 27, 2026 by tmoosting via publish #257
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant