/// <summary> /// Ips the is authorized. /// </summary> /// <param name="context">The context.</param> /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns> private bool IpIsAuthorized(AuthorizationFilterContext context) { HttpRequest request = context.HttpContext.Request; string ip = HttpRequestExtensions.GetUserHostAddress(request.HttpContext.Request); if (string.IsNullOrEmpty(ip)) { return(false); } if (this.ValiadIPRegex == null) { return(ip == "::1"); } return(this.ValiadIPRegex.IsMatch(ip) || ip == "::1"); }