mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-21 22:05:43 -04:00
Changed: Align GetValueOrDefault extension with netcore3.0 version
- netcore3.0 implements the extenion on IReadOnlyDictionary. - Dictionary implements both IReadonlyDictionary and IDictionary and so defining the extenion on both interfaces creates an ambiguous reference - IDictionary doesn't inherit from IReadOnlyDictionary Either we have to add 'using NzbDrone.Common.Extenions;' separately to resolve the ambiguity or we have to standardaize on only having the extension on IReadOnlyDictionary.
This commit is contained in:
@@ -6,7 +6,6 @@ using Nancy;
|
||||
using Nancy.Bootstrapper;
|
||||
using NLog;
|
||||
using NzbDrone.Common.EnvironmentInfo;
|
||||
using NzbDrone.Common.Extensions;
|
||||
|
||||
namespace Radarr.Http.Extensions.Pipelines
|
||||
{
|
||||
@@ -81,7 +80,7 @@ namespace Radarr.Http.Extensions.Pipelines
|
||||
|
||||
private static bool ContentLengthIsTooSmall(Response response)
|
||||
{
|
||||
var contentLength = response.Headers.GetValueOrDefault("Content-Length");
|
||||
var contentLength = response.Headers.TryGetValue("Content-Length", out var value) ? value : null;
|
||||
|
||||
if (contentLength != null && long.Parse(contentLength) < 1024)
|
||||
{
|
||||
@@ -93,7 +92,7 @@ namespace Radarr.Http.Extensions.Pipelines
|
||||
|
||||
private static bool AlreadyGzipEncoded(Response response)
|
||||
{
|
||||
var contentEncoding = response.Headers.GetValueOrDefault("Content-Encoding");
|
||||
var contentEncoding = response.Headers.TryGetValue("Content-Encoding", out var value) ? value : null;
|
||||
|
||||
if (contentEncoding == "gzip")
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user