mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-03-16 07:06:18 +00:00
Merge pull request #2742 from Bond-009/warn18
Enable Microsoft.CodeAnalysis.FxCopAnalyzers for Jellyfin.Common
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
|
||||
UserAgent = "Emby/3.0",
|
||||
|
||||
// Shouldn't matter but may cause issues
|
||||
DecompressionMethod = CompressionMethod.None
|
||||
DecompressionMethod = CompressionMethods.None
|
||||
};
|
||||
|
||||
using (var response = await _httpClient.SendAsync(httpRequestOptions, HttpMethod.Get).ConfigureAwait(false))
|
||||
|
||||
@@ -635,7 +635,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.DecompressionMethod = CompressionMethod.Deflate;
|
||||
options.DecompressionMethod = CompressionMethods.Deflate;
|
||||
|
||||
try
|
||||
{
|
||||
@@ -665,7 +665,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.DecompressionMethod = CompressionMethod.Deflate;
|
||||
options.DecompressionMethod = CompressionMethods.Deflate;
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
@@ -83,7 +83,7 @@ namespace Emby.Server.Implementations.LiveTv.Listings
|
||||
{
|
||||
CancellationToken = cancellationToken,
|
||||
Url = path,
|
||||
DecompressionMethod = CompressionMethod.Gzip,
|
||||
DecompressionMethod = CompressionMethods.Gzip,
|
||||
},
|
||||
HttpMethod.Get).ConfigureAwait(false))
|
||||
using (var stream = res.Content)
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
|
||||
Url = url,
|
||||
CancellationToken = CancellationToken.None,
|
||||
BufferContent = false,
|
||||
DecompressionMethod = CompressionMethod.None
|
||||
DecompressionMethod = CompressionMethods.None
|
||||
};
|
||||
|
||||
foreach (var header in mediaSource.RequiredHttpHeaders)
|
||||
|
||||
Reference in New Issue
Block a user