Fixed /register-kill not using filtering.

/register-kill didn't use the same filtering as /test resulting in users failing to get kills because url malformed. /test was also hanging app for response so fixed this.
This commit is contained in:
Heavy Bob 2025-04-09 23:53:07 +10:00
parent 1e0cf4ce0d
commit f7fb63c50f
6 changed files with 301 additions and 53 deletions
AutoTrackR2

View file

@ -155,7 +155,12 @@ public static class WebHandler
Console.WriteLine($"Time (UTC): {DateTimeOffset.UtcNow}");
Console.WriteLine("=== End Debug Info ===\n");
var response = await httpClient.PostAsync(ConfigManager.ApiUrl + "register-kill", new StringContent(jsonData, Encoding.UTF8, "application/json"));
// Ensure proper URL formatting
string baseUrl = Regex.Replace(ConfigManager.ApiUrl ?? "", @"(https?://[^/]+)/?.*", "$1");
string endpoint = "register-kill";
string fullUrl = $"{baseUrl}/{endpoint}";
var response = await httpClient.PostAsync(fullUrl, new StringContent(jsonData, Encoding.UTF8, "application/json"));
if (response.StatusCode != HttpStatusCode.OK)
{
Console.WriteLine("Failed to submit kill data:");