From 6e8b4e76ac65aa6f50e28b405f08ad5868b885db Mon Sep 17 00:00:00 2001 From: kjh2064 Date: Mon, 29 Jun 2026 15:47:07 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20TaxFilingBrowserClient=EC=9D=98=20API=20?= =?UTF-8?q?=EB=9D=BC=EC=9A=B0=ED=8A=B8=20=EA=B2=BD=EB=A1=9C=20=EC=98=A4?= =?UTF-8?q?=ED=83=80=20=EB=B0=8F=20prefix=20=EB=88=84=EB=9D=BD=20=EC=98=A4?= =?UTF-8?q?=EB=A5=98=20=EC=88=98=EC=A0=95=20(tax-filing=20->=20api/taxfili?= =?UTF-8?q?ng)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TaxBaik.Web/Program.cs | 3 +-- TaxBaik.Web/Services/TaxFilingBrowserClient.cs | 18 +++++++++--------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/TaxBaik.Web/Program.cs b/TaxBaik.Web/Program.cs index 9fe1141..8dacc37 100644 --- a/TaxBaik.Web/Program.cs +++ b/TaxBaik.Web/Program.cs @@ -229,8 +229,7 @@ builder.Services.AddHttpClient(client builder.Services.AddHttpClient(client => { client.BaseAddress = new Uri(apiBaseUrl); -}) - .AddHttpMessageHandler(); +}); builder.Services.AddHttpClient(client => { client.BaseAddress = new Uri(apiBaseUrl); diff --git a/TaxBaik.Web/Services/TaxFilingBrowserClient.cs b/TaxBaik.Web/Services/TaxFilingBrowserClient.cs index f0fd6c2..cd3afb2 100644 --- a/TaxBaik.Web/Services/TaxFilingBrowserClient.cs +++ b/TaxBaik.Web/Services/TaxFilingBrowserClient.cs @@ -32,10 +32,10 @@ public class TaxFilingBrowserClient : ITaxFilingBrowserClient private void EnsureAuthHeader() { - if (!string.IsNullOrEmpty(_tokenStore.AccessToken) && !_http.DefaultRequestHeaders.Contains("Authorization")) - { + if (!string.IsNullOrEmpty(_tokenStore.AccessToken)) _http.DefaultRequestHeaders.Authorization = new("Bearer", _tokenStore.AccessToken); - } + else + _http.DefaultRequestHeaders.Authorization = null; } public async Task> GetUpcomingAsync(int daysAhead = 30, CancellationToken ct = default) @@ -44,7 +44,7 @@ public class TaxFilingBrowserClient : ITaxFilingBrowserClient { EnsureAuthHeader(); var result = await _http.GetFromJsonAsync( - $"tax-filing/upcoming?daysAhead={daysAhead}", cancellationToken: ct); + $"api/taxfiling/upcoming?daysAhead={daysAhead}", cancellationToken: ct); return result?.Data ?? []; } catch (HttpRequestException ex) @@ -60,7 +60,7 @@ public class TaxFilingBrowserClient : ITaxFilingBrowserClient { EnsureAuthHeader(); var result = await _http.GetFromJsonAsync( - $"tax-filing/client/{clientId}", cancellationToken: ct); + $"api/taxfiling/client/{clientId}", cancellationToken: ct); return result?.Data ?? []; } catch (HttpRequestException ex) @@ -76,7 +76,7 @@ public class TaxFilingBrowserClient : ITaxFilingBrowserClient { EnsureAuthHeader(); return await _http.GetFromJsonAsync( - $"tax-filing/{id}", cancellationToken: ct); + $"api/taxfiling/{id}", cancellationToken: ct); } catch (HttpRequestException ex) { @@ -90,7 +90,7 @@ public class TaxFilingBrowserClient : ITaxFilingBrowserClient try { EnsureAuthHeader(); - var response = await _http.PostAsJsonAsync("tax-filing", filing, cancellationToken: ct); + var response = await _http.PostAsJsonAsync("api/taxfiling", filing, cancellationToken: ct); if (!response.IsSuccessStatusCode) return null; @@ -111,7 +111,7 @@ public class TaxFilingBrowserClient : ITaxFilingBrowserClient try { EnsureAuthHeader(); - var response = await _http.PutAsJsonAsync($"tax-filing/{id}", filing, cancellationToken: ct); + var response = await _http.PutAsJsonAsync($"api/taxfiling/{id}", filing, cancellationToken: ct); if (!response.IsSuccessStatusCode) return null; @@ -132,7 +132,7 @@ public class TaxFilingBrowserClient : ITaxFilingBrowserClient try { EnsureAuthHeader(); - var response = await _http.DeleteAsync($"tax-filing/{id}", cancellationToken: ct); + var response = await _http.DeleteAsync($"api/taxfiling/{id}", cancellationToken: ct); return response.IsSuccessStatusCode; } catch (HttpRequestException ex)