feat: add cors

This commit is contained in:
2026-05-12 18:30:07 +03:00
parent 5795ade06e
commit c248d42d93

View File

@@ -5,6 +5,7 @@ from typing import AsyncGenerator
from apscheduler.schedulers.asyncio import AsyncIOScheduler
from fastapi import Depends,FastAPI
from fastapi.exceptions import RequestValidationError
from fastapi.middleware.cors import CORSMiddleware
from fastapi.openapi.docs import get_redoc_html, get_swagger_ui_html
from fastapi.responses import HTMLResponse
from fastapi.security import HTTPBasic, HTTPBasicCredentials
@@ -23,6 +24,7 @@ from src.presentation.handlers import application_exception_handler,unhandled_ex
from src.presentation.middleware import TraceIDMiddleware, SecurityHeadersMiddleware
from src.presentation.routing import kyc_router
security = HTTPBasic()
@@ -121,6 +123,13 @@ app.add_middleware(
"object-src 'none'"
),
)
app.add_middleware(
CORSMiddleware,
allow_origins=['*'],
allow_credentials=True,
allow_methods=['*'],
allow_headers=['*'],
)
@app.get('/docs', include_in_schema=False)