-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add CORS headers to Read Only Gateway Default config #2778
Conversation
License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
I like this idea, but people more knowledgable on http should review this, cc @diasdavid @travisperson @dignifiedquire |
I would suggest adding a test using curl to ensure it works as expected. See here for some details http://stackoverflow.com/questions/12173990/how-can-you-debug-a-cors-request-with-curl |
We have tests for CORS headers, this just changes the default. https://github.com/ipfs/go-ipfs/blob/master/test/sharness/t0112-gateway-cors.sh |
then you should add a test without changing the config so we know the default is working as epxected |
License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
I've modified the test. |
This LGTM, sorry for the long wait |
Also deployed to gateways |
thanks for pushing for that test @dignifiedquire 👍 |
Was that test actually created? @Kubuxu ? |
The test case is the fact that we don't have to explicitly set those settings in sharness for tests to succeed. See removed config calls. |
This is not a specific test case. if this fails, it will take a long time to debug because of those other things failing not being super clear. remember that people who are not you will be hit by this. there should be test case that tests this as the first one to fail so debugging + fixing is easy. |
Thank you for this. Here is the federated wiki pull request that benefits from this change. |
@WardCunningham this change is part of v0.4.3-rc4: https://dist.ipfs.io/go-ipfs/v0.4.3-rc4 |
I have upgraded to go-ipfs version 0.4.5 and then I still don't see Does it mean that changes in the default config don't automatically apply to earlier adopters of go-ipfs? The chat log from fedwiki/wiki-client#173 seems to say they don't: Then what exactly should I do myself (and recommend to the other IPFS users) to make the necessary changes in the local configuration and enable CORS? |
You can run:
|
Thanks, it has worked. For future references, on Windows the equivalent commands are
|
I still think we should add these to the default config, as suggested here |
It is in default config. |
…ault Add CORS headers to Read Only Gateway Default config
…n-gateway-by-default Add CORS headers to Read Only Gateway Default config
…n-gateway-by-default Add CORS headers to Read Only Gateway Default config
This will allow for weider use of local gateway from different sites.
For example: ipfs.pics could use JS to use either their global or user's local gateway.
I might work on piece of JS doing just that but I don't really like JS. 😄
License: MIT
Signed-off-by: Jakub Sztandera kubuxu@protonmail.ch