Commit 7c7420ac authored by Vitalii Fisenko's avatar Vitalii Fisenko
Browse files

Add cors resource options

parent 56ac85e5
......@@ -19,8 +19,15 @@ async def on_shutdown(app):
LOG.info('Shutting down application')
def setup_cors(app):
cors = aiohttp_cors.setup(app, defaults={"*": aiohttp_cors.ResourceOptions()})
def setup_cors(app, routes):
cors = aiohttp_cors.setup(app, defaults={
"*": aiohttp_cors.ResourceOptions(
allow_credentials=True,
expose_headers="*",
allow_headers="*",
)
})
for route in list(app.router.routes()):
cors.add(route)
......@@ -40,7 +47,7 @@ def create_application():
tools.request_unpack_params
])
app.add_routes(routes)
setup_cors(app)
setup_cors(app, routes)
if SWAGGER_DOC_AVAILABLE:
from aiohttp_swagger import setup_swagger
setup_swagger(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment