From 178de54739e5d26b86df7b8472563d2e9f1992bd Mon Sep 17 00:00:00 2001 From: Tomas Sanchez Date: Fri, 5 May 2023 21:01:03 -0300 Subject: [PATCH] hotfix: CORS middleware for API Gateway --- api-gateway/app/asgi.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/api-gateway/app/asgi.py b/api-gateway/app/asgi.py index 553384c..e023e3c 100644 --- a/api-gateway/app/asgi.py +++ b/api-gateway/app/asgi.py @@ -4,6 +4,7 @@ import logging from fastapi import FastAPI +from starlette.middleware.cors import CORSMiddleware from app.adapters.http_client import aio_http_client from app.router import api_router_v1, root_router @@ -109,6 +110,14 @@ def get_application() -> FastAPI: openapi_tags=tags_metadata, ) + app.add_middleware( + CORSMiddleware, + allow_origins=["*"], + allow_credentials=True, + allow_methods=["*"], + allow_headers=["*"], + ) + log.debug("Add application routes.") app.include_router(root_router)