From 87234ac6adcf6c04d7033deed2c66b6f85378b22 Mon Sep 17 00:00:00 2001 From: leonid Tsybulsky Date: Wed, 11 Sep 2024 14:08:18 +0300 Subject: [PATCH] remove CORS for test --- app/core/config.py | 2 -- app/main.py | 10 ---------- 2 files changed, 12 deletions(-) diff --git a/app/core/config.py b/app/core/config.py index e7c7a21..e5b20d2 100644 --- a/app/core/config.py +++ b/app/core/config.py @@ -31,8 +31,6 @@ class Settings(BaseSettings): EMAIL_USE_TLS: bool = True # ================================ - host: str = 'localhost' - class Config: env_file = 'infra/.env' extra = "ignore" diff --git a/app/main.py b/app/main.py index 7991366..a0da043 100644 --- a/app/main.py +++ b/app/main.py @@ -2,7 +2,6 @@ import sys from fastapi import FastAPI, applications -from fastapi.middleware.cors import CORSMiddleware from fastapi.openapi.docs import get_swagger_ui_html from sqladmin import Admin @@ -43,15 +42,6 @@ def swagger_monkey_patch(*args, **kwargs): openapi_url="/api/openapi.json", ) -origins = [f'http://{settings.host}'] - -app.add_middleware( - CORSMiddleware, - allow_origins=origins, - allow_credentials=True, - allow_methods=['*'], - allow_headers=['*'], -) if "pytest" not in sys.modules: app.add_middleware(LoggerMiddleware)