Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disallowed Header in RPC request from stellar-sdk when using quicknode #946

Open
carlosdimatteo opened this issue Apr 25, 2024 · 1 comment
Labels

Comments

@carlosdimatteo
Copy link

Describe the bug
Unable to use Quicknode rpc url with stellar-sdk in browser because it throws CORS error related to sdk including "X-Client-Version" headers in RPC requests

What version are you on?
11.3.0

To Reproduce
Steps to reproduce the behavior:

  1. setup stellar-sdk with a quicknode rpc url in a Browser JS proj
  2. try to execute any interaction for example
const rpc = new SorobanRpc.Server(url);
const data = await rpc.getLatestLedger();
  1. CORS error will show up :
Access to XMLHttpRequest at URL from origin HOST has been blocked by CORS policy: Request header field x-client-version is not allowed by Access-Control-Allow-Headers in preflight 

Expected behavior
Usual RPC network requests to work without error

Additional context

  • Did some debugging and reproducing the request with fetch() but removing X-Client-Version and X-Client-Name headers seemed to fix the issue
  • This is likely an issue with the way Quicknode sets up their RPC server but putting it here first for better traceability
  • headers are set here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants
@carlosdimatteo and others