-
-
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 correct access control headers to the default api config #1979
Add correct access control headers to the default api config #1979
Conversation
b1b6fe7
to
863556f
Compare
863556f
to
ec08d34
Compare
LGTM, thank you for catching this one @dignifiedquire :) For more context: https://botbot.me/freenode/ipfs/2015-11-19/?msg=54525489&page=9 |
@dignifiedquire you'll need to fix the type your using in the config init:
|
@whyrusleeping I was looking at that and wondering if it would make more sense to have the config coming from the JSON blob, instead of .go generating the config (this way could be one of those global things that other implementations use) |
@diasdavid i'm not sure what youre saying. The JSON blob gets loaded into this struct so its easier to work with in go. (types are nice, mkay) |
@whyrusleeping If I'm reading it right, when |
Will fix the type in the morning.. |
@diasdavid, some of the config is generated dynamically to make changing certain values easier. |
"Access-Control-Allow-Headers": "X-Stream-Output, X-Chunked-Output", | ||
"Access-Control-Expose-Headers": "X-Stream-Output, X-Chunked-Output", | ||
}, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add them also to Gateway
, because gateway also has an API. (we need to rename these... not sure on good names)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jbenet sorry not sure where exactly, do you mean on l. 83?
54fa7dc
to
dc4b819
Compare
@whyrusleeping I fixed the tests, anything else that I should do? |
I meant add the same headers to the "Gateway" config key as well.
|
@jbenet done (or so I think) |
this LGTM, though it seems kinda hacky, is this a config option we would ever want to change? if not, maybe it should go into the gateway code, and be hardcoded in? |
@whyrusleeping tbh you know this better than I, these headers are directly dependent on the headers you are using in the api, so as long as you don't change those you don't have to change these here. |
@jbenet @whyrusleeping we really need this in 0.3.10 this is causing issues for a lot of people trying to use js-ipfs-api. Do you need anything else from my side? |
License: MIT Signed-off-by: Friedel Ziegelmayer <dignifiedquire@gmail.com>
License: MIT Signed-off-by: Friedel Ziegelmayer <dignifiedquire@gmail.com>
License: MIT Signed-off-by: Friedel Ziegelmayer <dignifiedquire@gmail.com>
7286afe
to
b036b23
Compare
well, i think if this is needed it shouldn't be a config value-- +1 to hardcoding this into where we set the defaults. |
Nedded to fix ipfs-inactive/js-ipfs-http-client#76 and for ipfs-inactive/js-ipfs-http-client#128 for details why this is needed see: ipfs-inactive/js-ipfs-http-client#76 (comment)
Probably lots wrong with this, so please excuse any obvious mistakes