mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-05 21:33:02 +02:00
Fix build
This commit is contained in:
parent
ac5c0866f3
commit
f6b8cd4b46
|
@ -22,16 +22,6 @@ namespace MediaBrowser.Common.Net
|
||||||
_httpClient = httpClient;
|
_httpClient = httpClient;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Make GET request.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="url">Url to request.</param>
|
|
||||||
/// <returns>A <see cref="Task"/> containing the <see cref="HttpResponseMessage"/>.</returns>
|
|
||||||
public Task<HttpResponseMessage> GetAsync(string url)
|
|
||||||
{
|
|
||||||
return _httpClient.GetAsync(url);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Make GET request.
|
/// Make GET request.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -42,17 +32,6 @@ namespace MediaBrowser.Common.Net
|
||||||
return _httpClient.GetAsync(url);
|
return _httpClient.GetAsync(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Make GET request.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="url">Url to request.</param>
|
|
||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
|
||||||
/// <returns>A <see cref="Task"/> containing the <see cref="HttpResponseMessage"/>.</returns>
|
|
||||||
public Task<HttpResponseMessage> GetAsync(string url, CancellationToken cancellationToken)
|
|
||||||
{
|
|
||||||
return _httpClient.GetAsync(url, cancellationToken);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Make GET request.
|
/// Make GET request.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -64,16 +43,6 @@ namespace MediaBrowser.Common.Net
|
||||||
return _httpClient.GetAsync(url, cancellationToken);
|
return _httpClient.GetAsync(url, cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get stream.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="url">Url to get stream from.</param>
|
|
||||||
/// <returns>A <see cref="Task"/> containing the <see cref="Stream"/>.</returns>
|
|
||||||
public Task<Stream> GetStreamAsync(string url)
|
|
||||||
{
|
|
||||||
return _httpClient.GetStreamAsync(url);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get stream.
|
/// Get stream.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -8,7 +8,9 @@ namespace MediaBrowser.Common.Net
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class DefaultHttpClientHandler : HttpClientHandler
|
public class DefaultHttpClientHandler : HttpClientHandler
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="DefaultHttpClientHandler"/> class.
|
||||||
|
/// </summary>
|
||||||
public DefaultHttpClientHandler()
|
public DefaultHttpClientHandler()
|
||||||
{
|
{
|
||||||
// TODO change to DecompressionMethods.All with .NET5
|
// TODO change to DecompressionMethods.All with .NET5
|
||||||
|
|
|
@ -14,10 +14,13 @@ namespace MediaBrowser.Common.Net
|
||||||
{
|
{
|
||||||
private readonly ProductInfoHeaderValue[] _userAgentValues;
|
private readonly ProductInfoHeaderValue[] _userAgentValues;
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="UserAgentDelegatingHandler"/> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="applicationHost">Instance of the <see cref="IApplicationHost"/> interface.</param>
|
||||||
public UserAgentDelegatingHandler(IApplicationHost applicationHost)
|
public UserAgentDelegatingHandler(IApplicationHost applicationHost)
|
||||||
{
|
{
|
||||||
_userAgentValues = new []
|
_userAgentValues = new[]
|
||||||
{
|
{
|
||||||
new ProductInfoHeaderValue(applicationHost.Name.Replace(' ', '-'), applicationHost.ApplicationVersionString),
|
new ProductInfoHeaderValue(applicationHost.Name.Replace(' ', '-'), applicationHost.ApplicationVersionString),
|
||||||
new ProductInfoHeaderValue($"({Environment.OSVersion}; {applicationHost.ApplicationUserAgentAddress})")
|
new ProductInfoHeaderValue($"({Environment.OSVersion}; {applicationHost.ApplicationUserAgentAddress})")
|
||||||
|
|
Loading…
Reference in a new issue