mirror of
https://github.com/BubbaGumpShrump/AutoTrackR2.git
synced 2025-07-25 18:57:50 +00:00
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:
parent
1e0cf4ce0d
commit
f7fb63c50f
6 changed files with 301 additions and 53 deletions
AutoTrackR2
|
@ -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:");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue