mirror of
https://github.com/2dust/v2rayN.git
synced 2026-10-31 01:24:59 +03:00
Add custom HTTP headers for subscription updates (#10118)
* Add custom HTTP headers for subscription updates * Res --------- Co-authored-by: 2dust <31833384+2dust@users.noreply.github.com>
This commit is contained in:
@@ -13,6 +13,8 @@ public class DownloadService
|
||||
|
||||
public string? AcceptHeader { get; init; }
|
||||
|
||||
public IReadOnlyDictionary<string, string>? RequestHeaders { get; init; }
|
||||
|
||||
private static readonly string _tag = "DownloadService";
|
||||
|
||||
/// <summary>
|
||||
@@ -246,7 +248,7 @@ public class DownloadService
|
||||
handler.SslOptions.RemoteCertificateValidationCallback = null;
|
||||
}
|
||||
|
||||
using var client = new HttpClient(handler)
|
||||
using var client = new HttpClient(HttpRequestHeadersHelper.CreateHandler(handler, RequestHeaders))
|
||||
{
|
||||
Timeout = Timeout.InfiniteTimeSpan
|
||||
};
|
||||
@@ -297,7 +299,7 @@ public class DownloadService
|
||||
{
|
||||
userAgent = Utils.GetVersion(false);
|
||||
}
|
||||
var result = await DownloaderHelper.Instance.DownloadStringAsync(webProxy, url, userAgent, timeout);
|
||||
var result = await DownloaderHelper.Instance.DownloadStringAsync(webProxy, url, userAgent, timeout, RequestHeaders, AcceptHeader);
|
||||
return result;
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
Reference in New Issue
Block a user