codex-storage / codex-js

Codex SDK in Javascript to interact with the Codex decentralized storage network.
Apache License 2.0
1 stars 0 forks source link

CORS issues #5

Open vpavlin opened 1 month ago

vpavlin commented 1 month ago

I am trying to use JS to work with Codex REST API, but it fails with CORS errors:

Access to fetch at 'http://localhost:8080/api/codex/v1/data' from origin 'http://localhost:3000' has been blocked by CORS policy: Request header field baggage is not allowed by Access-Control-Allow-Headers in preflight response.

l590hk/:1 Access to fetch at 'http://localhost:8080/api/codex/v1/data/zDvZRwzm5omymLDT998Eexu5sJL126SM1RAsJPZi1itHzVzKUJGF/network/manifest' from origin 'http://localhost:3000' has been blocked by CORS policy: Request header field baggage is not allowed by Access-Control-Allow-Headers in preflight response.

I am not sure if this needs to be fixed in the client or in the REST API itself.

2-towns commented 1 month ago

@vpavlin Well, that's a weird error because the SDK is not sending the baggage header. Do you have a specific configuration for propagating Telemetry in fetch requests?

Can you try with version 0.0.12 ?