From 11682fb117817588fbce953e3c4dec42729bce1e Mon Sep 17 00:00:00 2001 From: CHOSOOGEUN <241898164+CHOSOOGEUN@users.noreply.github.com> Date: Mon, 11 May 2026 16:52:46 +0900 Subject: [PATCH] =?UTF-8?q?fix(cors):=20prod=20=EB=8F=84=EB=A9=94=EC=9D=B8?= =?UTF-8?q?=EC=9D=84=20CORS=5FORIGINS=20=EC=97=90=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 증상: 팀원이 dev/외부 호스트에서 prod backend(https://gateguardsystems.com) 호출 시 CORS 에러. preflight OPTIONS 응답이 400 + ACAO 헤더 누락. prod frontend(same-origin) 는 영향 없지만 cross-origin 호출 차단됨. 원인: CORS_ORIGINS 가 localhost 5종만 허용. prod 도메인 미포함이라 FastAPI CORSMiddleware 가 매칭 실패 시 400 + ACAO 헤더 안 붙임. 수정: https://gateguardsystems.com, https://www.gateguardsystems.com 추가. Co-Authored-By: Claude Opus 4.7 (1M context) --- backend/app/core/config.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/backend/app/core/config.py b/backend/app/core/config.py index 3ecb158..eb3af6b 100644 --- a/backend/app/core/config.py +++ b/backend/app/core/config.py @@ -26,7 +26,15 @@ class Settings(BaseSettings): # 앱 DEBUG: bool = True - CORS_ORIGINS: List[str] = ["http://localhost:3000", "http://localhost:5173", "http://localhost:5174", "http://127.0.0.1:5173", "http://127.0.0.1:5174"] + CORS_ORIGINS: List[str] = [ + "http://localhost:3000", + "http://localhost:5173", + "http://localhost:5174", + "http://127.0.0.1:5173", + "http://127.0.0.1:5174", + "https://gateguardsystems.com", + "https://www.gateguardsystems.com", + ] settings = Settings()