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

Add CORs middleware #2081

Open
rossmeredith opened this issue Mar 12, 2024 · 1 comment
Open

Add CORs middleware #2081

rossmeredith opened this issue Mar 12, 2024 · 1 comment

Comments

@rossmeredith
Copy link

Hi

Not sure if I should log this with yourselves or strawberry: https://github.com/strawberry-graphql/strawberry.

I encountered the following problem: using storybook locally on port 6006 I was unable to make a request to my django web app which is using both django-channels and the graphql library strawberry. The reason is the consumer class provided by strawberry doesn't handle the pre-flight request where the method is "OPTION".

Would it be possible to add a CORS middleware to this library?

I found the following which seems to work: https://github.com/hot666666/asgi-cors-strawberry/blob/main/asgi_cors_strawberry/middleware.py

I'd feel better using it though if you guys could validate it in the course of adding it to the channels library.

Let me know if it would be better to log this with strawberry.

Thanks.

@rossmeredith
Copy link
Author

Not even a comment?

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

No branches or pull requests

1 participant