From 58f101bc61d6a4b254503a04267c339ef95c0e75 Mon Sep 17 00:00:00 2001 From: barelyprofessional <150058423+barelyprofessional@users.noreply.github.com> Date: Tue, 22 Jul 2025 23:00:05 -0500 Subject: [PATCH] Changed from stream to string as reusing the stream doesn't work --- KfChatDotNetBot/Services/KfTokenService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/KfChatDotNetBot/Services/KfTokenService.cs b/KfChatDotNetBot/Services/KfTokenService.cs index bfd94b2..b619a10 100644 --- a/KfChatDotNetBot/Services/KfTokenService.cs +++ b/KfChatDotNetBot/Services/KfTokenService.cs @@ -78,14 +78,14 @@ public class KfTokenService throw new Exception("Failed to solve the challenge"); } - private async Task GetLoginPage() + private async Task GetLoginPage() { _logger.Debug("Checking clearance token is actually valid first"); await CheckClearanceToken(); using var client = new HttpClient(GetHttpClientHandler()); var response = await client.GetAsync($"https://{_kfDomain}/login", _ctx); response.EnsureSuccessStatusCode(); - var content = await response.Content.ReadAsStreamAsync(_ctx); + var content = await response.Content.ReadAsStringAsync(_ctx); var document = new HtmlDocument(); document.Load(content); var challengeData = document.DocumentNode.SelectSingleNode("//html[@id=\"sssg\"]");