diff --git a/SHM.Utilities/BrewProvider.cs b/SHM.Utilities/BrewProvider.cs index 84f16e6..ac860d3 100644 --- a/SHM.Utilities/BrewProvider.cs +++ b/SHM.Utilities/BrewProvider.cs @@ -52,7 +52,11 @@ public async Task> RetrieveRawAsync(string source) public async Task> RetrieveRawFromVitaDbAsync(string source = null) { source = source ?? Constants.VitaDBBrewsListUri; - return await Try.ItAsync(async () => await source.GetJsonAsync>()) ?? new List(); + return await Try.ItAsync(async () => + await source + .WithHeader("User-Agent", "Other") + .GetJsonAsync>()) + ?? new List(); } public bool IsKindRetrievable(BrewKind kind) diff --git a/SHM/FormGetHomebrew.cs b/SHM/FormGetHomebrew.cs index 3f032e7..ba69b7b 100644 --- a/SHM/FormGetHomebrew.cs +++ b/SHM/FormGetHomebrew.cs @@ -137,6 +137,7 @@ private void LoadVitadb_sync(string path, Action> result)// bool addD try { WebClient wc = new WebClient(); + wc.Headers.Add("User-Agent: Other"); string content = wc.DownloadString(new Uri(path)); wc.Dispose(); content = Encoding.UTF8.GetString(Encoding.Default.GetBytes(content)); @@ -187,6 +188,7 @@ private void LoadDatabase_sync(string path, Action> result)// bool ad try { WebClient wc = new WebClient(); + wc.Headers.Add("User-Agent: Other"); string content = wc.DownloadString(new Uri(path)); wc.Dispose(); content = Encoding.UTF8.GetString(Encoding.Default.GetBytes(content));