mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-08 04:18:06 +02:00
fixed http get method
This commit is contained in:
parent
2e358a5968
commit
0984474c17
1 changed files with 17 additions and 17 deletions
|
@ -92,7 +92,8 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager
|
||||||
{
|
{
|
||||||
var handler = new WebRequestHandler
|
var handler = new WebRequestHandler
|
||||||
{
|
{
|
||||||
CachePolicy = new RequestCachePolicy(RequestCacheLevel.BypassCache)
|
CachePolicy = new RequestCachePolicy(RequestCacheLevel.BypassCache),
|
||||||
|
AutomaticDecompression = DecompressionMethods.None
|
||||||
};
|
};
|
||||||
|
|
||||||
client = new HttpClient(handler);
|
client = new HttpClient(handler);
|
||||||
|
@ -163,8 +164,8 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager
|
||||||
{
|
{
|
||||||
cancellationToken.ThrowIfCancellationRequested();
|
cancellationToken.ThrowIfCancellationRequested();
|
||||||
|
|
||||||
using (var response = await GetHttpClient(GetHostFromUrl(url)).SendAsync(message, HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false))
|
var response = await GetHttpClient(GetHostFromUrl(url)).SendAsync(message, HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
|
||||||
{
|
|
||||||
EnsureSuccessStatusCode(response);
|
EnsureSuccessStatusCode(response);
|
||||||
|
|
||||||
cancellationToken.ThrowIfCancellationRequested();
|
cancellationToken.ThrowIfCancellationRequested();
|
||||||
|
@ -185,7 +186,6 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager
|
||||||
|
|
||||||
return await response.Content.ReadAsStreamAsync().ConfigureAwait(false);
|
return await response.Content.ReadAsStreamAsync().ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
catch (OperationCanceledException ex)
|
catch (OperationCanceledException ex)
|
||||||
{
|
{
|
||||||
throw GetCancellationException(url, cancellationToken, ex);
|
throw GetCancellationException(url, cancellationToken, ex);
|
||||||
|
|
Loading…
Reference in a new issue