File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -1140,7 +1140,8 @@ private static async Task<Uri> TrackerAsync(string username)
1140
1140
url . ToString ( ) ,
1141
1141
false ,
1142
1142
false ,
1143
- false
1143
+ false ,
1144
+ true
1144
1145
)
1145
1146
. ConfigureAwait ( false ) ;
1146
1147
var numericStatusCode = ( short ) response . StatusCode ;
Original file line number Diff line number Diff line change @@ -172,14 +172,21 @@ public static async Task<RestResponse> DoCachedRequestAsync(
172
172
string url ,
173
173
bool addRiotAuth ,
174
174
bool bypassCache = false ,
175
- bool displayError = true
175
+ bool displayError = true ,
176
+ bool userAgentTrickery = false
176
177
)
177
178
{
178
179
var attemptCache = method == Method . Get && ! bypassCache ;
179
180
if ( attemptCache )
180
181
if ( Constants . UrlToBody . TryGetValue ( url , out var res ) )
181
182
return res ;
182
183
var client = new RestClient ( url ) ;
184
+
185
+ if ( userAgentTrickery )
186
+ {
187
+ client . AddDefaultHeader ( "User-Agent" , "Mozilla/5.0" ) ;
188
+ }
189
+
183
190
var request = new RestRequest ( ) ;
184
191
if ( addRiotAuth )
185
192
{
You can’t perform that action at this time.
0 commit comments