Skip to content

Commit

Permalink
I hate this
Browse files Browse the repository at this point in the history
  • Loading branch information
suchmememanyskill committed Apr 20, 2024
1 parent 2c303d7 commit 9566dc6
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions StlSpy/Utils/Request.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,12 @@ public static string GetString(Uri uri, Dictionary<string, string> headers)

public static async Task<string> GetStringAsync(Uri uri, Dictionary<string, string> headers, int timeoutSeconds = 100)
{
using (var client = new HttpClient())
using (var client = new WebClient())
{
foreach (var kv in headers)
client.DefaultRequestHeaders.Add(kv.Key, kv.Value);

client.Timeout = TimeSpan.FromSeconds(timeoutSeconds);

return await client.GetStringAsync(uri);
client.Headers[kv.Key] = kv.Value;
client.Encoding = System.Text.Encoding.UTF8;
return await client.DownloadStringTaskAsync(uri);
}
}

Expand Down

0 comments on commit 9566dc6

Please sign in to comment.