-
Notifications
You must be signed in to change notification settings - Fork 875
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
Remove the need for setting CORS headers #728
Comments
I think the issue here is that we're using the js-ipfs-http-client code from the webui to make the http requests, rather than passing in a proxy for an ipfs instances as companion does This technique is nice and simple, but we may have to switch it out for an injected proxy object if we want to avoid CORS dancing. |
@olizilla perhaps we could make a proxy to communicate directly with the API on the main process and take advantage of the fact that IPFS Redux Bundle can use an Edit: I can find some issues of making a proxy between the main and renderer processes: there are some values returned by the API that aren't serializable such as Big.js numbers, file uploads, etc... |
AFAIK Electron is using |
Although our solution might not be considered perfect, we don't need to set the CORS headers anymore. I'm closing this! |
Summary
Right now IPFS Desktop is automatically adding CORS headers to
$IPFS_PATH/config
:https://github.com/ipfs-shipyard/ipfs-desktop/blob/8f912ce816e2cd2e1c634fe8cdab54e2eb37cedf/src/utils/daemon.js#L59-L64
Without the above, Web UI won't load.
We should look into ways we can make it work without the need for touching
API.HTTPHeaders
, eg. see how IPFS Companion deals with the same problem.Background Discussion
@olizilla asked:
@lidel suggested:
The text was updated successfully, but these errors were encountered: