diff options
| author | cvium <clausvium@gmail.com> | 2021-09-10 11:40:28 +0200 |
|---|---|---|
| committer | cvium <clausvium@gmail.com> | 2021-09-10 11:40:28 +0200 |
| commit | 8496d7638ab7823169c220b615289c401cefa9a0 (patch) | |
| tree | 66134cb10250319dc4be0dc8abf6b2a6573e4cbf /Jellyfin.Api/Auth/BaseAuthorizationHandler.cs | |
| parent | fb7587dd84784afb7c64aadf1fc2d0bab5251814 (diff) | |
| parent | b96dbbf553820861eab9d1a453adcc8ce8a9ef05 (diff) | |
Merge branch 'master' into NetworkAccessPolicy
Diffstat (limited to 'Jellyfin.Api/Auth/BaseAuthorizationHandler.cs')
| -rw-r--r-- | Jellyfin.Api/Auth/BaseAuthorizationHandler.cs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Jellyfin.Api/Auth/BaseAuthorizationHandler.cs b/Jellyfin.Api/Auth/BaseAuthorizationHandler.cs index 456f45d97..62d590b18 100644 --- a/Jellyfin.Api/Auth/BaseAuthorizationHandler.cs +++ b/Jellyfin.Api/Auth/BaseAuthorizationHandler.cs @@ -87,8 +87,9 @@ namespace Jellyfin.Api.Auth return false; } - var ip = _httpContextAccessor.HttpContext.GetNormalizedRemoteIp(); - var isInLocalNetwork = _networkManager.IsInLocalNetwork(ip); + var isInLocalNetwork = _httpContextAccessor.HttpContext != null + && _networkManager.IsInLocalNetwork(_httpContextAccessor.HttpContext.GetNormalizedRemoteIp()); + // User cannot access remotely and user is remote if (!user.HasPermission(PermissionKind.EnableRemoteAccess) && !isInLocalNetwork) { |
