aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs
diff options
context:
space:
mode:
authorBond_009 <bond.009@outlook.com>2023-10-24 00:10:31 +0200
committerBond_009 <bond.009@outlook.com>2023-11-14 21:14:21 +0100
commitb62b0ec2b581369de42c69305773f0edb9d701b4 (patch)
tree32ca62e7429f51654b9d22b1be87f2c658535568 /Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs
parent99e0d46ad93c1f2e62aed67c26b92f256610f1a6 (diff)
Fix warnings
Diffstat (limited to 'Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs')
-rw-r--r--Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs8
1 files changed, 5 insertions, 3 deletions
diff --git a/Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs b/Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs
index 753029f2c..92c483c0f 100644
--- a/Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs
+++ b/Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs
@@ -30,12 +30,14 @@ using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Cors.Infrastructure;
+using Microsoft.AspNetCore.HttpOverrides;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.OpenApi.Any;
using Microsoft.OpenApi.Interfaces;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;
using AuthenticationSchemes = Jellyfin.Api.Constants.AuthenticationSchemes;
+using IPNetwork = System.Net.IPNetwork;
namespace Jellyfin.Server.Extensions
{
@@ -277,9 +279,9 @@ namespace Jellyfin.Server.Extensions
}
else if (NetworkUtils.TryParseToSubnet(allowedProxies[i], out var subnet))
{
- if (subnet is not null)
+ if (subnet.HasValue)
{
- AddIPAddress(config, options, subnet.BaseAddress, subnet.PrefixLength);
+ AddIPAddress(config, options, subnet.Value.BaseAddress, subnet.Value.PrefixLength);
}
}
else if (NetworkUtils.TryParseHost(allowedProxies[i], out var addresses, config.EnableIPv4, config.EnableIPv6))
@@ -310,7 +312,7 @@ namespace Jellyfin.Server.Extensions
}
else
{
- options.KnownNetworks.Add(new IPNetwork(addr, prefixLength));
+ options.KnownNetworks.Add(new Microsoft.AspNetCore.HttpOverrides.IPNetwork(addr, prefixLength));
}
}