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

CORS support for Apollo Client Awareness headers #127

Closed
Tracked by #66
sjungling opened this issue Nov 11, 2021 · 2 comments · Fixed by #917
Closed
Tracked by #66

CORS support for Apollo Client Awareness headers #127

sjungling opened this issue Nov 11, 2021 · 2 comments · Fixed by #917
Assignees

Comments

@sjungling
Copy link
Contributor

Is your feature request related to a problem? Please describe.
While testing router, I ran into issues with my app and disallowed headers.

Eventually, I traced it down to the name option on the ApolloClient constructor which is a part of the Client Awareness functionality that sets apollographql-client-name header on all requests.

Once I added that header to the allowed headers CORS configuration, it worked like a charm.

Describe the solution you'd like
It would be nice if these two headers were a part of the default Allow Headers for the CORS configuration.

Describe alternatives you've considered
An alternative is to have folks define those allowed headers in the router config. This could be accomplished, in part, with documentation about this.

Additional context
Add any other context or screenshots about the feature request here.

@abernix
Copy link
Member

abernix commented Jan 31, 2022

Thanks for opening this! I imagine this could be another configuration "knob" that could be in a similar place as where the config for #373 ends up. I've tacked this on as a "todo" in #66 for consideration, too.

@abernix abernix changed the title Native Support for Apollo Client Awareness headers CORS support for Apollo Client Awareness headers Feb 17, 2022
@abernix abernix removed the triage label Feb 17, 2022
@Geal Geal self-assigned this Apr 5, 2022
@abernix
Copy link
Member

abernix commented Apr 25, 2022

I think an approach here could be:

  • Set the Apollo headers as the default CORS headers
  • Document that if you don't want to use the defaults, you need to put some CORS configuration in place.

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

Successfully merging a pull request may close this issue.

3 participants