Available on crate feature
server only.Expand description
CORS helpers for exposing x402 response headers to browser clients.
A browser-based buyer needs to read the Payment-Required and
Payment-Response headers from cross-origin responses. That read is
blocked by default unless the server explicitly advertises the headers
via Access-Control-Expose-Headers. ensure_expose_headers merges the
x402 entries into any existing value (idempotent).
Constants§
- X402_
EXPOSED_ HEADERS - The canonical list of x402 response headers clients need to see.
Functions§
- ensure_
expose_ headers - Ensures
Access-Control-Expose-Headersonheadersadvertises the x402 response headers. Idempotent: calling more than once is a no-op.