Repository navigation
x402-lint reads the Payment-Required header before the body - #103
Merged
Merged
Conversation
An x402 v2 seller keeps its requirements in the Payment-Required header and often answers with a
body of {}. Reading only the body made this tool call a working v2 endpoint schema-invalid
(measured 2026-10-24 against our own live paid route: 'x402Version: Invalid discriminator value'),
and the hosted tool at x402-lint.tokenizen.nl did the same.
The header is now read first (base64 JSON or plain JSON), the body is the fallback, and the report
says which one was used (new optional field source). Four new tests, red on the old code, green now.
README gets an erratum. Version 0.1.1; publishing it is a separate step.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
tokenizen | d5afc0e | Commit Preview URL Branch Preview URL |
Oct 24 2026, 11:32 AM |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
tokenizen-website | d5afc0e | Commit Preview URL Branch Preview URL |
Oct 24 2026, 11:33 AM |
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.
x402 v2 sellers keep their requirements in the Payment-Required header and often answer with a body of {}. x402-lint read only the body, so it called a working v2 endpoint schema-invalid. Measured on 2026-10-24 against our own live paid route (api.tokenizen.nl/api/paid/verify-ownership), both with the library and with the hosted tool at x402-lint.tokenizen.nl: 'x402Version: Invalid discriminator value'.
The header is now read first, the body is the fallback, and the report says which one it used (new optional field source). Four new tests, red on the old code and green now; the existing tests are unchanged. README has an erratum. Version bumped to 0.1.1; publishing and redeploying the hosted service are separate steps.