From 4fe3d0480edf4fc09b810867c873bf7417b25a4b Mon Sep 17 00:00:00 2001 From: Artem Kashaev Date: Mon, 1 Dec 2025 12:55:51 +0500 Subject: [PATCH] fix: update CORS settings to allow all origins temporarily --- app/main.py | 12 ++++++++++-- frontend/dev-dist/sw.js | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app/main.py b/app/main.py index 84c6c52..f8ba4ad 100644 --- a/app/main.py +++ b/app/main.py @@ -1,4 +1,5 @@ """FastAPI application factory.""" + from __future__ import annotations from collections.abc import AsyncIterator @@ -13,9 +14,9 @@ from app.core.middleware.cache_monitor import CacheAvailabilityMiddleware from fastapi.middleware.cors import CORSMiddleware - def create_app() -> FastAPI: """Build FastAPI application instance.""" + @asynccontextmanager async def lifespan(_: FastAPI) -> AsyncIterator[None]: await init_cache() @@ -29,7 +30,14 @@ def create_app() -> FastAPI: application.add_middleware(CacheAvailabilityMiddleware) application.add_middleware( CORSMiddleware, - allow_origins=["https://kitchen-crm.k1nq.tech", "http://192.168.31.51"], + allow_origins=[ + # "https://kitchen-crm.k1nq.tech", + # "http://192.168.31.51", + # "http://localhost:8000", + # "http://0.0.0.0:8000", + # "http://127.0.0.1:8000", + "*" # ! TODO: Убрать + ], allow_credentials=True, allow_methods=["*"], # Разрешить все HTTP-методы allow_headers=["*"], # Разрешить все заголовки diff --git a/frontend/dev-dist/sw.js b/frontend/dev-dist/sw.js index fcd1ce9..4d200a3 100644 --- a/frontend/dev-dist/sw.js +++ b/frontend/dev-dist/sw.js @@ -82,7 +82,7 @@ define(['./workbox-c5fd805d'], (function (workbox) { 'use strict'; "revision": "d41d8cd98f00b204e9800998ecf8427e" }, { "url": "index.html", - "revision": "0.h29q0vck9ug" + "revision": "0.nhqann807f" }], {}); workbox.cleanupOutdatedCaches(); workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {