aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Auth/BaseAuthorizationHandler.cs
diff options
context:
space:
mode:
authorDavid <daullmer@gmail.com>2020-08-01 17:42:33 +0200
committerGitHub <noreply@github.com>2020-08-01 17:42:33 +0200
commitd50a02203650743f02016c13acfe9a45c3397d09 (patch)
tree176cc960ac5c90cf05c561fd6786dd06f45e7aa4 /Jellyfin.Api/Auth/BaseAuthorizationHandler.cs
parent2cb6eb984b82601147cc0bab2592d7ab896d495d (diff)
parent52ba54a71b8290d45ed0cbf9f3673b66d99c62e1 (diff)
Merge pull request #3775 from crobibero/api-dynamic-hls
Move DynamicHlsService to Jellyfin.Api
Diffstat (limited to 'Jellyfin.Api/Auth/BaseAuthorizationHandler.cs')
-rw-r--r--Jellyfin.Api/Auth/BaseAuthorizationHandler.cs7
1 files changed, 1 insertions, 6 deletions
diff --git a/Jellyfin.Api/Auth/BaseAuthorizationHandler.cs b/Jellyfin.Api/Auth/BaseAuthorizationHandler.cs
index 9fde175d0..495ff9d12 100644
--- a/Jellyfin.Api/Auth/BaseAuthorizationHandler.cs
+++ b/Jellyfin.Api/Auth/BaseAuthorizationHandler.cs
@@ -70,7 +70,7 @@ namespace Jellyfin.Api.Auth
return false;
}
- var ip = NormalizeIp(_httpContextAccessor.HttpContext.Connection.RemoteIpAddress).ToString();
+ var ip = RequestHelpers.NormalizeIp(_httpContextAccessor.HttpContext.Connection.RemoteIpAddress).ToString();
var isInLocalNetwork = _networkManager.IsInLocalNetwork(ip);
// User cannot access remotely and user is remote
if (!user.HasPermission(PermissionKind.EnableRemoteAccess) && !isInLocalNetwork)
@@ -100,10 +100,5 @@ namespace Jellyfin.Api.Auth
return true;
}
-
- private static IPAddress NormalizeIp(IPAddress ip)
- {
- return ip.IsIPv4MappedToIPv6 ? ip.MapToIPv4() : ip;
- }
}
}