|
|
|
@ -96,13 +96,13 @@ namespace Emby.Server.Implementations.HttpClientManager
|
|
|
|
|
|
|
|
|
|
switch (options.DecompressionMethod)
|
|
|
|
|
{
|
|
|
|
|
case CompressionMethod.Deflate | CompressionMethod.Gzip:
|
|
|
|
|
case CompressionMethods.Deflate | CompressionMethods.Gzip:
|
|
|
|
|
request.Headers.Add(HeaderNames.AcceptEncoding, new[] { "gzip", "deflate" });
|
|
|
|
|
break;
|
|
|
|
|
case CompressionMethod.Deflate:
|
|
|
|
|
case CompressionMethods.Deflate:
|
|
|
|
|
request.Headers.Add(HeaderNames.AcceptEncoding, "deflate");
|
|
|
|
|
break;
|
|
|
|
|
case CompressionMethod.Gzip:
|
|
|
|
|
case CompressionMethods.Gzip:
|
|
|
|
|
request.Headers.Add(HeaderNames.AcceptEncoding, "gzip");
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
@ -239,15 +239,10 @@ namespace Emby.Server.Implementations.HttpClientManager
|
|
|
|
|
|
|
|
|
|
var httpWebRequest = GetRequestMessage(options, httpMethod);
|
|
|
|
|
|
|
|
|
|
if (options.RequestContentBytes != null
|
|
|
|
|
|| !string.IsNullOrEmpty(options.RequestContent)
|
|
|
|
|
if (!string.IsNullOrEmpty(options.RequestContent)
|
|
|
|
|
|| httpMethod == HttpMethod.Post)
|
|
|
|
|
{
|
|
|
|
|
if (options.RequestContentBytes != null)
|
|
|
|
|
{
|
|
|
|
|
httpWebRequest.Content = new ByteArrayContent(options.RequestContentBytes);
|
|
|
|
|
}
|
|
|
|
|
else if (options.RequestContent != null)
|
|
|
|
|
if (options.RequestContent != null)
|
|
|
|
|
{
|
|
|
|
|
httpWebRequest.Content = new StringContent(
|
|
|
|
|
options.RequestContent,
|
|
|
|
|