From 4f9749d09ea9e4e50c845665380e5e7ce453da12 Mon Sep 17 00:00:00 2001 From: glax Date: Sat, 26 Aug 2023 01:51:16 +0200 Subject: [PATCH] Fix bug with MangaDex, Useragent --- Tranga/DownloadClient.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Tranga/DownloadClient.cs b/Tranga/DownloadClient.cs index 2951598..5b00a06 100644 --- a/Tranga/DownloadClient.cs +++ b/Tranga/DownloadClient.cs @@ -1,4 +1,5 @@ using System.Net; +using System.Net.Http.Headers; using Logging; namespace Tranga; @@ -7,7 +8,14 @@ internal class DownloadClient { private static readonly HttpClient Client = new() { - Timeout = TimeSpan.FromSeconds(60) + Timeout = TimeSpan.FromSeconds(60), + DefaultRequestHeaders = + { + UserAgent = + { + new ProductInfoHeaderValue("Tranga", "0.1") + } + } }; private readonly Dictionary _lastExecutedRateLimit;