From 34df08d65af7f25b12106dba8d15de1eb38ecef7 Mon Sep 17 00:00:00 2001 From: kjh2064 Date: Mon, 6 Jul 2026 17:24:21 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20=EC=8B=A4?= =?UTF-8?q?=ED=8C=A8=20=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95=20=E2=80=94?= =?UTF-8?q?=20Cloudflare=20=EA=B2=BD=EC=9C=A0=20=EC=9E=90=EA=B8=B0?= =?UTF-8?q?=ED=98=B8=EC=B6=9C=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제: Login.cshtml.cs에서 Request.Host/Scheme으로 URL을 조립해 외부 도메인(quant.taxbaik.com, Cloudflare 경유)으로 API를 재호출. Cloudflare가 요청을 변형/차단하여 401/400 반환 → 로그인 실패. 해결: 내부 API 호출을 localhost:5265로 고정하여 Cloudflare 우회 제거. 검증: POST https://quant.taxbaik.com/api/auth/login → 200 OK 확인. --- src/dotnet/QuantEngine.Web/Pages/Account/Login.cshtml.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/dotnet/QuantEngine.Web/Pages/Account/Login.cshtml.cs b/src/dotnet/QuantEngine.Web/Pages/Account/Login.cshtml.cs index 0f0e22d..03295a9 100644 --- a/src/dotnet/QuantEngine.Web/Pages/Account/Login.cshtml.cs +++ b/src/dotnet/QuantEngine.Web/Pages/Account/Login.cshtml.cs @@ -42,9 +42,10 @@ namespace QuantEngine.Web.Pages.Account try { var loginRequest = new { Username = username, Password = password }; - var scheme = string.IsNullOrWhiteSpace(Request.Scheme) ? "http" : Request.Scheme; - var host = Request.Host.HasValue ? Request.Host.Value : "localhost:5265"; - var requestUri = $"{scheme}://{host}/api/auth/login"; + // Always call the internal API directly to avoid Cloudflare proxy interference. + // Request.Host / Request.Scheme must NOT be used here — they resolve to the external + // domain which causes the self-call to go out through Cloudflare and return 400. + var requestUri = "http://localhost:5265/api/auth/login"; var response = await _httpClient.PostAsJsonAsync(requestUri, loginRequest); if (response.IsSuccessStatusCode)