Fixes issues with HttpClientManager

This commit is contained in:
Bond_009
2019-06-14 16:32:37 +02:00
parent 54c6f02ebb
commit d405a400aa
10 changed files with 119 additions and 140 deletions

View File

@@ -71,7 +71,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
UserAgent = "Emby/3.0",
// Shouldn't matter but may cause issues
EnableHttpCompression = false
DecompressionMethod = CompressionMethod.None
};
using (var response = await _httpClient.SendAsync(httpRequestOptions, "GET").ConfigureAwait(false))

View File

@@ -627,15 +627,7 @@ namespace Emby.Server.Implementations.LiveTv.Listings
ListingsProviderInfo providerInfo)
{
// Schedules direct requires that the client support compression and will return a 400 response without it
options.EnableHttpCompression = true;
// On windows 7 under .net core, this header is not getting added
#if NETSTANDARD2_0
if (Environment.OSVersion.Platform == PlatformID.Win32NT)
{
options.RequestHeaders[HeaderNames.AcceptEncoding] = "deflate";
}
#endif
options.DecompressionMethod = CompressionMethod.Deflate;
try
{
@@ -665,15 +657,7 @@ namespace Emby.Server.Implementations.LiveTv.Listings
ListingsProviderInfo providerInfo)
{
// Schedules direct requires that the client support compression and will return a 400 response without it
options.EnableHttpCompression = true;
// On windows 7 under .net core, this header is not getting added
#if NETSTANDARD2_0
if (Environment.OSVersion.Platform == PlatformID.Win32NT)
{
options.RequestHeaders[HeaderNames.AcceptEncoding] = "deflate";
}
#endif
options.DecompressionMethod = CompressionMethod.Deflate;
try
{

View File

@@ -73,11 +73,9 @@ namespace Emby.Server.Implementations.LiveTv.Listings
CancellationToken = cancellationToken,
Url = path,
Progress = new SimpleProgress<double>(),
DecompressionMethod = CompressionMethod.Gzip,
// It's going to come back gzipped regardless of this value
// So we need to make sure the decompression method is set to gzip
EnableHttpCompression = true,
DecompressionMethod = CompressionMethod.Gzip,
UserAgent = "Emby/3.0"

View File

@@ -47,7 +47,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
CancellationToken = CancellationToken.None,
BufferContent = false,
EnableHttpCompression = false,
DecompressionMethod = CompressionMethod.None,
};
foreach (var header in mediaSource.RequiredHttpHeaders)