Skip to content

Commit

Permalink
fix: detection of tracker.gg
Browse files Browse the repository at this point in the history
closes #8
  • Loading branch information
pwall2222 committed Mar 29, 2024
1 parent 79bc8f7 commit 877ff39
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion NOWT/Helpers/LiveMatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1140,7 +1140,8 @@ private static async Task<Uri> TrackerAsync(string username)
url.ToString(),
false,
false,
false
false,
true
)
.ConfigureAwait(false);
var numericStatusCode = (short)response.StatusCode;
Expand Down
9 changes: 8 additions & 1 deletion NOWT/Helpers/Login.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,21 @@ public static async Task<RestResponse> DoCachedRequestAsync(
string url,
bool addRiotAuth,
bool bypassCache = false,
bool displayError = true
bool displayError = true,
bool userAgentTrickery = false
)
{
var attemptCache = method == Method.Get && !bypassCache;
if (attemptCache)
if (Constants.UrlToBody.TryGetValue(url, out var res))
return res;
var client = new RestClient(url);

if (userAgentTrickery)
{
client.AddDefaultHeader("User-Agent", "Mozilla/5.0");
}

var request = new RestRequest();
if (addRiotAuth)
{
Expand Down

0 comments on commit 877ff39

Please sign in to comment.