Skip to content

fix(checkout): strip payment headers from ctx.request.raw on malformed re-challenge -> v2.5.9 - #91

Merged
vvillait88 merged 1 commit into
mainfrom
fix/strip-raw-malformed-rechallenge
Jul 17, 2026
Merged

fix(checkout): strip payment headers from ctx.request.raw on malformed re-challenge -> v2.5.9#91
vvillait88 merged 1 commit into
mainfrom
fix/strip-raw-malformed-rechallenge

Conversation

@vvillait88

Copy link
Copy Markdown
Contributor

Parity with node-commerce 2.7.3 (a live mppx validate smoke surfaced the node case). The malformed re-challenge left ctx.request.raw carrying the junk credential; hooks reading raw (e.g. mint_multichain_recipients) raised 401 instead of the fresh 402. Fix wraps raw in a header-stripping proxy. Regression test exercises a hook reading ctx.request.raw. Gate green: ruff/format/ty/vulture, 1836 tests, 95.35%.

🤖 Generated with Claude Code

…d re-challenge

Parity with node-commerce 2.7.3. The malformed re-challenge stripped the
CheckoutRequest headers but left the native request (ctx.request.raw) carrying
the junk credential, so hooks that read raw (e.g. mint_multichain_recipients,
which parses the MPP credential off raw's Authorization: Payment header) still
saw the junk and raised 401, turning the fresh-402 re-challenge into a dead end.

Fix wraps raw in a header-stripping proxy so the re-entry is a discovery leg for
every view of the request. Regression test exercises a hook reading
ctx.request.raw (the martin-estate shape); non-payment headers still pass through.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vvillait88
vvillait88 merged commit 8313db2 into main Jul 17, 2026
7 checks passed
@vvillait88
vvillait88 deleted the fix/strip-raw-malformed-rechallenge branch July 17, 2026 22:28
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