fix(checkout): strip payment headers from ctx.request.raw on malformed re-challenge -> v2.5.9 - #91
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Parity with node-commerce 2.7.3 (a live mppx validate smoke surfaced the node case). The malformed re-challenge left
ctx.request.rawcarrying 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 readingctx.request.raw. Gate green: ruff/format/ty/vulture, 1836 tests, 95.35%.🤖 Generated with Claude Code