Skip to content

fix(stripe-style): form-encoded bodies are valid, not bad JSON - #57

Merged
deblasis merged 1 commit into
mainfrom
fix/stripe-form-tolerant-guard
Aug 16, 2026
Merged

fix(stripe-style): form-encoded bodies are valid, not bad JSON#57
deblasis merged 1 commit into
mainfrom
fix/stripe-form-tolerant-guard

Conversation

@deblasis

Copy link
Copy Markdown
Contributor

Companion to the bracket-notation form parser (#56): real SDK clients POST application/x-www-form-urlencoded, which the engine now turns into nested req.body structures — but _bad_body still demanded decodable JSON and 400'd SDK creates before handlers ran. Form content-type is now accepted (the engine already parsed it); JSON bodies keep the strict malformed-JSON 400.

Proven end-to-end: a real stripe-node client creates a checkout session, the hosted page completes it, and the receiver's webhooks.constructEvent verifies the Stripe-Signature and parses event.data.object — plus tamper-rejection.

Real SDK clients (stripe-node) POST application/x-www-form-urlencoded,
which the engine now parses into nested req.body structures — the
_bad_body JSON guard was rejecting them with 400 'could not parse as
JSON' before handlers ran. Found by dogfooding a real stripe-node
client against the checkout-session create flow.
@deblasis
deblasis merged commit 3462e94 into main Aug 16, 2026
1 check passed
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