Available on crate features
client or server only.Expand description
x402 HTTP header names and Cache-Control helpers.
Request: PAYMENT_SIGNATURE, SIGN_IN_WITH_X (never emit as response).
Response: PAYMENT_REQUIRED, PAYMENT_RESPONSE.
Facilitator-only: EXTENSION_RESPONSES (not buyer CORS).
Constants§
- EXTENSION_
RESPONSES - Facilitator-only sidechannel. Not a buyer CORS expose/allow header.
- PAYMENT_
REQUIRED - 402 challenge header carrying a base64
PaymentRequired. - PAYMENT_
RESPONSE - Settlement receipt header carrying a base64
SettleResponse. - PAYMENT_
SIGNATURE - Buyer retry header carrying a base64
PaymentPayload. - SIGN_
IN_ WITH_ X - SIWX proof header (base64 JSON). Never emit as a response header.
- X402_
ALLOW_ HEADERS - CORS
Access-Control-Allow-Headersvalue for the appCorsLayer. - X402_
EXPOSED_ HEADERS - CORS
Access-Control-Expose-Headersvalue for x402 response headers.
Functions§
- ensure_
expose_ headers - Ensures
Access-Control-Expose-Headersadvertises the x402 response headers. - merge_
private - Merges
privateintoCache-Control(200 +Payment-Response). - set_
no_ store - Writes
Cache-Control: no-store(402 / 412 / settle-fail).