From c32d9cadff0cef960f25153736761ebf4c532417 Mon Sep 17 00:00:00 2001 From: azyges <229218900+azyges@users.noreply.github.com> Date: Sat, 11 Oct 2025 10:15:51 +0900 Subject: [PATCH] fix leak --- .../ServerConfiguration/ServerConfigurationManager.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/LightlessSync/Services/ServerConfiguration/ServerConfigurationManager.cs b/LightlessSync/Services/ServerConfiguration/ServerConfigurationManager.cs index 25d9796..388ac87 100644 --- a/LightlessSync/Services/ServerConfiguration/ServerConfigurationManager.cs +++ b/LightlessSync/Services/ServerConfiguration/ServerConfigurationManager.cs @@ -607,8 +607,9 @@ public class ServerConfigurationManager { var baseUri = serverUri.Replace("wss://", "https://").Replace("ws://", "http://"); var oauthCheckUri = LightlessAuth.GetUIDsFullPath(new Uri(baseUri)); - _httpClient.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", token); - var response = await _httpClient.GetAsync(oauthCheckUri).ConfigureAwait(false); + using var request = new HttpRequestMessage(HttpMethod.Get, oauthCheckUri); + request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", token); + using var response = await _httpClient.SendAsync(request).ConfigureAwait(false); var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false); return await JsonSerializer.DeserializeAsync>(responseStream).ConfigureAwait(false) ?? []; }