-
Notifications
You must be signed in to change notification settings - Fork 1
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
missing CORS header on trustless-gateway.link #4
Comments
|
specs are tracked in ipfs/specs#423 until we have them, as a rule of thumb, always assume public gateways must have liberal CORS so other websites can fetch content from them |
@lidel we already have a function that applies the liberal CORS: https://github.com/ipfs/boxo/blob/main/gateway/gateway.go#L431. If your suggestion is to apply it by default, I would also suggest stopping to export it. It seems fine to me to change the default, as long as we make it clear. |
I assumed we forgot to enable CORS in Rainbow, and it had to be added in Nginx, but I've checked latest Kubo and @ns4plabs any idea why |
I'm not sure this is working in Kubo 0.25.0, unless I've misconfigured it. I have enabled CORS on the API with:
And turned on the routing API on the gateway and enabled CORS with:
I can make a fetch request to the API from any origin with:
But I get errors from the routing API:
|
@achingbrain that is indeed a bug. The config gateway headers are applied solely to the gateway handler, and to nothing else on that HTTP listener. @lidel I see two options:
|
Yep, it is a bug, since @hacdias +1 to refactoring things and moving implicit/explicit header setup into a dedicated reusable middleware handler (example, we would write our own version). I think we should have it in In Kubo, the middleware would add all implicit headers and CORS from boxo/gateway + add any user provided configuration from This way it is in one place and we don't need to pass anything into the routing handler. |
We rolled out https://github.com/protocol/bifrost-infra/pull/2826 and now the Rainbow headers are passed through |
I believe we can probably close this now. confirmed that requests are working properly at https://codepen.io/SgtPooki/pen/JjxYpZX |
Confirming this is working too. Can be closed @lidel (I don't have permissions) |
trustless-gateway.link can't be used in browser due to missing CORS header.
Repro steps
@SgtPooki created demo at https://codepen.io/SgtPooki/pen/JjxYpZX
Can be reproduced by looking at Network tab in devtools.
Problem
I think the exact problem is that response is missing
access-control-allow-origin: *
:cc @SgtPooki @ns4plabs @2color
The text was updated successfully, but these errors were encountered: