aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server/Middleware
diff options
context:
space:
mode:
authorGreenback <jimcartlidge@yahoo.co.uk>2020-10-08 19:00:55 +0100
committerGreenback <jimcartlidge@yahoo.co.uk>2020-10-08 19:00:55 +0100
commitdeb4d27857089e8f3a3602399c5b52ad8df170f2 (patch)
tree18c3ec379b72e20843caff9dad907d1842cbcbd8 /Jellyfin.Server/Middleware
parenta3f0843ac97c64a8a412d707baa9870d0e53dcff (diff)
Moved all settings across to network.xml
Diffstat (limited to 'Jellyfin.Server/Middleware')
-rw-r--r--Jellyfin.Server/Middleware/BaseUrlRedirectionMiddleware.cs3
-rw-r--r--Jellyfin.Server/Middleware/IpBasedAccessValidationMiddleware.cs5
-rw-r--r--Jellyfin.Server/Middleware/LanFilteringMiddleware.cs3
3 files changed, 7 insertions, 4 deletions
diff --git a/Jellyfin.Server/Middleware/BaseUrlRedirectionMiddleware.cs b/Jellyfin.Server/Middleware/BaseUrlRedirectionMiddleware.cs
index 9316737bdf..c23da2fd63 100644
--- a/Jellyfin.Server/Middleware/BaseUrlRedirectionMiddleware.cs
+++ b/Jellyfin.Server/Middleware/BaseUrlRedirectionMiddleware.cs
@@ -1,5 +1,6 @@
using System;
using System.Threading.Tasks;
+using Jellyfin.Networking.Configuration;
using MediaBrowser.Controller.Configuration;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Configuration;
@@ -42,7 +43,7 @@ namespace Jellyfin.Server.Middleware
public async Task Invoke(HttpContext httpContext, IServerConfigurationManager serverConfigurationManager)
{
var localPath = httpContext.Request.Path.ToString();
- var baseUrlPrefix = serverConfigurationManager.Configuration.BaseUrl;
+ var baseUrlPrefix = serverConfigurationManager.GetNetworkConfiguration().BaseUrl;
if (string.Equals(localPath, baseUrlPrefix + "/", StringComparison.OrdinalIgnoreCase)
|| string.Equals(localPath, baseUrlPrefix, StringComparison.OrdinalIgnoreCase)
diff --git a/Jellyfin.Server/Middleware/IpBasedAccessValidationMiddleware.cs b/Jellyfin.Server/Middleware/IpBasedAccessValidationMiddleware.cs
index 0713d97d65..6f636819fc 100644
--- a/Jellyfin.Server/Middleware/IpBasedAccessValidationMiddleware.cs
+++ b/Jellyfin.Server/Middleware/IpBasedAccessValidationMiddleware.cs
@@ -1,5 +1,6 @@
using System.Net;
using System.Threading.Tasks;
+using Jellyfin.Networking.Configuration;
using MediaBrowser.Common.Extensions;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Configuration;
@@ -42,7 +43,7 @@ namespace Jellyfin.Server.Middleware
var remoteIp = httpContext.Connection.RemoteIpAddress ?? IPAddress.Loopback;
- if (serverConfigurationManager.Configuration.EnableRemoteAccess)
+ if (serverConfigurationManager.GetNetworkConfiguration().EnableRemoteAccess)
{
// Comma separated list of IP addresses or IP/netmask entries for networks that will be allowed to connect remotely.
// If left blank, all remote addresses will be allowed.
@@ -52,7 +53,7 @@ namespace Jellyfin.Server.Middleware
{
// remoteAddressFilter is a whitelist or blacklist.
bool isListed = remoteAddressFilter.Contains(remoteIp);
- if (!serverConfigurationManager.Configuration.IsRemoteIPFilterBlacklist)
+ if (!serverConfigurationManager.GetNetworkConfiguration().IsRemoteIPFilterBlacklist)
{
// Black list, so flip over.
isListed = !isListed;
diff --git a/Jellyfin.Server/Middleware/LanFilteringMiddleware.cs b/Jellyfin.Server/Middleware/LanFilteringMiddleware.cs
index 1ef460bd76..1f4e80053d 100644
--- a/Jellyfin.Server/Middleware/LanFilteringMiddleware.cs
+++ b/Jellyfin.Server/Middleware/LanFilteringMiddleware.cs
@@ -2,6 +2,7 @@ using System;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
+using Jellyfin.Networking.Configuration;
using MediaBrowser.Common.Extensions;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Configuration;
@@ -37,7 +38,7 @@ namespace Jellyfin.Server.Middleware
{
var host = httpContext.Connection.RemoteIpAddress ?? IPAddress.Loopback;
- if (!networkManager.IsInLocalNetwork(host) && !serverConfigurationManager.Configuration.EnableRemoteAccess)
+ if (!networkManager.IsInLocalNetwork(host) && !serverConfigurationManager.GetNetworkConfiguration().EnableRemoteAccess)
{
return;
}