mirror of
https://github.com/C9Glax/tranga.git
synced 2025-06-23 03:24:15 +02:00
Fix UserAgent RequestHeader:
UserAgent should not be added after it already existed
This commit is contained in:
@ -1,4 +1,5 @@
|
|||||||
using System.Net;
|
using System.Net;
|
||||||
|
using System.Net.Http.Headers;
|
||||||
using HtmlAgilityPack;
|
using HtmlAgilityPack;
|
||||||
|
|
||||||
namespace API.MangaDownloadClients;
|
namespace API.MangaDownloadClients;
|
||||||
@ -13,7 +14,8 @@ internal class HttpDownloadClient : DownloadClient
|
|||||||
|
|
||||||
public HttpDownloadClient()
|
public HttpDownloadClient()
|
||||||
{
|
{
|
||||||
Client.DefaultRequestHeaders.TryAddWithoutValidation("User-Agent", TrangaSettings.userAgent);
|
if(Client.DefaultRequestHeaders.UserAgent.Count < 1)
|
||||||
|
Client.DefaultRequestHeaders.UserAgent.Add(new ("Tranga", "2.0"));
|
||||||
}
|
}
|
||||||
|
|
||||||
internal override RequestResult MakeRequestInternal(string url, string? referrer = null, string? clickButton = null)
|
internal override RequestResult MakeRequestInternal(string url, string? referrer = null, string? clickButton = null)
|
||||||
|
Reference in New Issue
Block a user