Skip to content

fix(cors): allow X-Client-Name/X-Client-Version for browser RPC preflight - #144

Merged
AquiGorka merged 1 commit into
mainfrom
fix/cors-rpc-client-headers
Jul 29, 2026
Merged

fix(cors): allow X-Client-Name/X-Client-Version for browser RPC preflight#144
AquiGorka merged 1 commit into
mainfrom
fix/cors-rpc-client-headers

Conversation

@AquiGorka

Copy link
Copy Markdown
Contributor

Problem

The stellar-sdk RPC client attaches X-Client-Name / X-Client-Version headers to every Soroban RPC request. In production the CORS middleware only allowed Content-Type, Authorization, Traceparent, Tracestate, so the browser's CORS preflight to /api/v1/rpc failed:

blocked by CORS policy: Request header field x-client-name is not allowed by
Access-Control-Allow-Headers in preflight response

The console's server.getAccount() fetch was blocked before it was sent, and the SDK surfaced it as "Account not found" during council/provider deploys on mainnet. (Testnet ran MODE=development, whose allow-list is *, so it was never hit.)

Fix

Add X-Client-Name, X-Client-Version to the production Access-Control-Allow-Headers. Version bump triggers the mainnet redeploy.

Diagnosed via headed browser capture during the mainnet recording rig; server-side RPC calls succeeded, only the browser (CORS-enforced) was blocked.

…ght passes (release 0.9.17)

stellar-sdk sends X-Client-Name/X-Client-Version on RPC calls; production CORS
omitted them, so the browser blocked /api/v1/rpc preflight and getAccount failed
as 'Account not found'. Add them to Access-Control-Allow-Headers.
@AquiGorka
AquiGorka merged commit 86817e5 into main Jul 29, 2026
7 checks passed
@AquiGorka
AquiGorka deleted the fix/cors-rpc-client-headers branch July 29, 2026 21:54
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