Skip to content

Commit

Permalink
Update Reader.cs (#180)
Browse files Browse the repository at this point in the history
* Update Reader.cs

* CSharpier format

---------

Co-authored-by: gstraccini[bot] <150967461+gstraccini[bot]@users.noreply.github.com>
  • Loading branch information
guibranco and gstraccini[bot] authored Nov 20, 2024
1 parent 79f8c15 commit 519596a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions BancosBrasileiros.MergeTool/Helpers/Reader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ internal class Reader
private static string DownloadString(string url)
{
using var client = new HttpClient();
client.DefaultRequestHeaders.Add(
"User-Agent",
"BancosBrasileiros/1.0 (+https://github.com/guibranco/bancosbrasileiros)"
);
using var response = client.GetAsync(url).Result;
using var content = response.Content;
return content.ReadAsStringAsync().Result;
Expand All @@ -87,6 +91,10 @@ private static string DownloadString(string url)
private static byte[] DownloadBytes(string url)
{
using var client = new HttpClient();
client.DefaultRequestHeaders.Add(
"User-Agent",
"BancosBrasileiros/1.0 (+https://github.com/guibranco/bancosbrasileiros)"
);
return client.GetByteArrayAsync(url).Result;
}

Expand Down

0 comments on commit 519596a

Please sign in to comment.