-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[apollo-server-lambda] allow regex support for Acess-Control-Allow-Origin #4470
Comments
I have the same issue, is there a reason why the library does not support all options from Express? https://github.com/expressjs/cors#configuration-options |
I also need the ability to pass Function here as what expressjs cors middleware allows us to do. I'm using 'apollo-server-cloud-functions'. |
…ow-Origin (apollographql#4470) fix(apollo-server-cloud-functions): allow regex support for Access-Control-Allow-Origin (apollographql#4470)
+1 Took a bit of debugging to figure out what was going on, but seemed like we would just need to add regex matching as part of this if logic in ApolloServer Took a stab at adding to both |
Apollo Server 4 replaces a hard-coded set of web framework integrations with a simple stable API for building integrations. As part of this, the core project no longer directly supports a Lambda integration. Check out the |
To enable CORS response for requests with credentials (cookies, http authentication) the allow origin header must equal the request origin.
Current cors options
In the current scenario either we allow everything by setting it to true which will allow all domains, which is not ideal most of the times unless you're creating a public api.
Then there is an option of string array which makes it really hard to define all the possible subdomains and ports which are needed when developing locally.
I purpose to support regex array and/or regex which will really help to make sure you define exactly what you need in a very consistent manner.
For eg.
The text was updated successfully, but these errors were encountered: