Skip to content
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

backend: allow cross domain queries. wildcard CORS. #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jpierre03
Copy link
Contributor

CORS is a set of rules checked by browers and application servers to retrict access to ressources by domain/@ip...
Without correct http header, the browser discard data retreived from backend.

* allow frontend to query backend whather the domain = no restriction on
domain
* https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS
@domenkozar
Copy link
Contributor

domenkozar commented Feb 15, 2017

Thanks! This is needed only for development since frontend and backend are on different ports. I'd rather use something like https://github.com/Enlambda/nix-channelstatus/blob/master/frontend/webpack.config.js#L40

@expipiplus1
Copy link
Contributor

@jpierre03 Thank's for getting involved! If you're an IRC user please join us in #nixos-hercules on freenode!

@jpierre03
Copy link
Contributor Author

@domenkozar ok. But backend sould also handle CORS

@expipiplus1 :) Does a config file option to set CORS allowed domain is a good idea ?
If true, I can rework on this PR.

@expipiplus1
Copy link
Contributor

@jpierre03, this isn't really my domain, ho ho.

I'm happy to go with whatever you think is best as long as @domenkozar agrees.

@domenkozar
Copy link
Contributor

CORS is a collection of headers to tell the browser how to deal with cross-browser AJAX requests.

If someone is on a different domain than where API is hosted, this PR will allow it (meaning any domain) to query our API.

I'm not sure about all implications about this, we should be careful setting such wide spectrum default. @jpierre03 why do you think this is useful?

@domenkozar
Copy link
Contributor

On second thought, we could whitelist all apis that don't require the host and hardcode those that are protected. Need to think more about the use cases, but I wouldn't want to make any decisions in the early stage.

@domenkozar
Copy link
Contributor

So here's the PR for development: #36

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants