Skip to content

Commit 877ff39

Browse files
committed
fix: detection of tracker.gg
closes #8
1 parent 79bc8f7 commit 877ff39

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

NOWT/Helpers/LiveMatch.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1140,7 +1140,8 @@ private static async Task<Uri> TrackerAsync(string username)
11401140
url.ToString(),
11411141
false,
11421142
false,
1143-
false
1143+
false,
1144+
true
11441145
)
11451146
.ConfigureAwait(false);
11461147
var numericStatusCode = (short)response.StatusCode;

NOWT/Helpers/Login.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,14 +172,21 @@ public static async Task<RestResponse> DoCachedRequestAsync(
172172
string url,
173173
bool addRiotAuth,
174174
bool bypassCache = false,
175-
bool displayError = true
175+
bool displayError = true,
176+
bool userAgentTrickery = false
176177
)
177178
{
178179
var attemptCache = method == Method.Get && !bypassCache;
179180
if (attemptCache)
180181
if (Constants.UrlToBody.TryGetValue(url, out var res))
181182
return res;
182183
var client = new RestClient(url);
184+
185+
if (userAgentTrickery)
186+
{
187+
client.AddDefaultHeader("User-Agent", "Mozilla/5.0");
188+
}
189+
183190
var request = new RestRequest();
184191
if (addRiotAuth)
185192
{

0 commit comments

Comments
 (0)