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

ApolloServer CORS defaults can not be changed #1326

Closed
fcanela opened this issue Jul 10, 2018 · 4 comments
Closed

ApolloServer CORS defaults can not be changed #1326

fcanela opened this issue Jul 10, 2018 · 4 comments
Labels
⛲️ feature New addition or enhancement to existing solutions 🌹 has-reproduction ❤ Has a reproduction in Glitch, CodeSandbox or Git repository.

Comments

@fcanela
Copy link

fcanela commented Jul 10, 2018

Hello.

Currently apollo-server inserts Access-Control-Allow-Origin: * by default to ease development (https://github.com/apollographql/apollo-server/blob/version-2/packages/apollo-server/src/index.ts#L77).

This defaults seems reasonable but for production and certain configurations you may want to change it. For example, in our company we prefer to manage CORS with a reverse proxy so our API is more secure and IT can perform changes without touching API code.

Currently, changing this CORS default seems to be impossible with apollo-server (#1142). As Apollo Server v2 is in Release Candidate we understand this kind of features have not yet implemented.

I open this issue to enable discussion and know what is the maintainers opinion about CORS management and apollo-server v2.

@ghost ghost added 🌹 has-reproduction ❤ Has a reproduction in Glitch, CodeSandbox or Git repository. ⛲️ feature New addition or enhancement to existing solutions labels Jul 10, 2018
@piranna
Copy link

piranna commented Jul 10, 2018

The default is good for most cases, but makes sense that it should be a default and could be overriden if one developer wants it...

@Aitorpm
Copy link

Aitorpm commented Jul 11, 2018

Yes, we have the same issue! We need to customize the CORS filter too and don't use the default.

@evans
Copy link
Contributor

evans commented Jul 11, 2018

Thank you for the issue! We've added a cors option to apollo-server in the constructor with #1335, since it's a production necessary configuration. It will be in the next RC

@evans evans closed this as completed Jul 11, 2018
@fcanela
Copy link
Author

fcanela commented Jul 13, 2018

Wow, @evans! That was fast. Thanks for your PR.

Have the next RC any planed release schedule or something we can use to estimate?

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
⛲️ feature New addition or enhancement to existing solutions 🌹 has-reproduction ❤ Has a reproduction in Glitch, CodeSandbox or Git repository.
Projects
None yet
Development

No branches or pull requests

4 participants