diff options
| author | David <daullmer@gmail.com> | 2020-08-01 18:07:03 +0200 |
|---|---|---|
| committer | David <daullmer@gmail.com> | 2020-08-01 18:07:03 +0200 |
| commit | 74b34169636c5607e215db8e38e4933e0fc2b611 (patch) | |
| tree | 84c0f27d4a3c0c204a9f2173c8842703fd884bf2 /Jellyfin.Api/Auth/BaseAuthorizationHandler.cs | |
| parent | d3dc9da5d6780f110bc71b0772d27a97ebb0349f (diff) | |
| parent | d50a02203650743f02016c13acfe9a45c3397d09 (diff) | |
Merge remote-tracking branch 'jellyfin/api-migration' into api-universal-audio
Diffstat (limited to 'Jellyfin.Api/Auth/BaseAuthorizationHandler.cs')
| -rw-r--r-- | Jellyfin.Api/Auth/BaseAuthorizationHandler.cs | 7 |
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; - } } } |
