-
Notifications
You must be signed in to change notification settings - Fork 7
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
Support Cors headers #4
Comments
Hi @Dogfalo, Yes, there is a known issue with I suggest you to give a try of aiohttp-middlewares and its Hope it will work out for you —— To make it more obvious, I’ll update the documentation with tutorial on how to provide CORS headers for |
Thanks for the reply! I am just trying to understand, what makes the aiohttp-middleware different? Does it just add headers into the response of the handler without trying to create a new handler? |
The high-level details described in aiohttp-middlewares docs, but if you need more technical details, here they go.
This difference allows from aiohttp import web
from aiohttp_middlewares import cors_middleware
# Allow CORS requests from URL http://localhost:3000
app = web.Application(
middlewares=[
cors_middleware(origins=["http://localhost:3000"])
]
) More examples available in Hope this makes sense for you. |
Makes sense, thanks for the explanation! |
There doesn't seem to be any way currently to add CORS headers
I tried doing this with
aiohttp-cors
and received an error like this:The text was updated successfully, but these errors were encountered: