From d01fbe6ce3871a366c178e73b5c9bfcc3fc66ad5 Mon Sep 17 00:00:00 2001 From: barelyprofessional <150058423+barelyprofessional@users.noreply.github.com> Date: Thu, 5 Mar 2026 09:20:57 -0600 Subject: [PATCH] C# is so frustrating with HTTP. You couldn't imagine a more annoyingly autistic in the worst way possible HTTP client. Won't let you do anything to make it real world usable, and also enforces shit at runtime so you can't tell something is busted until hours later when your method finally hits. Anyway it balked at the Accept header but some more testing in curl reveals that perhaps that's not what the issue is, that it's freaking out due to a missing Origin and Referer headers. Though testing might be impeded by caching, it's hard to say. --- KfChatDotNetBot/Services/Shuffle.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/KfChatDotNetBot/Services/Shuffle.cs b/KfChatDotNetBot/Services/Shuffle.cs index 635704b..2a64cf7 100644 --- a/KfChatDotNetBot/Services/Shuffle.cs +++ b/KfChatDotNetBot/Services/Shuffle.cs @@ -185,8 +185,8 @@ public class Shuffle : IDisposable _logger.Debug($"Configured to use proxy {_proxy}"); } using var client = new HttpClient(handler); - client.DefaultRequestHeaders.Accept.Clear(); - client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/graphql-response+json,application/json;q=0.9")); + client.DefaultRequestHeaders.Referrer = new Uri($"https://shuffle.com/?md-id={betId}&modal=bet"); + client.DefaultRequestHeaders.TryAddWithoutValidation("Origin", "https://shuffle.com"); var postBody = JsonContent.Create(jsonBody); var response = await client.PostAsync("https://shuffle.com/main-api/graphql/api/graphql", postBody, _cancellationToken); var responseContent = await response.Content.ReadFromJsonAsync(cancellationToken: _cancellationToken);