Exemplo n.º 1
0
        public string ResolveIp(HttpRequest httpRequest)
        {
            IPAddress clientIp = null;


            if (!string.IsNullOrEmpty(httpRequest.Header[_headerName]))
            {
                clientIp = IpAddressUtil.ParseIp(httpRequest.Header[_headerName]);
            }

            return(clientIp?.ToString());
        }
Exemplo n.º 2
0
 public static bool ContainsIp(string ipRule, string clientIp)
 {
     return(IpAddressUtil.ContainsIp(ipRule, clientIp));
 }
Exemplo n.º 3
0
 public static IPAddress ParseIp(string ipAddress)
 {
     return(IpAddressUtil.ParseIp(ipAddress));
 }
Exemplo n.º 4
0
 public static bool ContainsIp(List <string> ipRules, string clientIp, out string rule)
 {
     return(IpAddressUtil.ContainsIp(ipRules, clientIp, out rule));
 }