public static GetAttributes ( |
||
ipAddress | ||
return | ServiceStack.Host.RequestAttributes |
public static RequestAttributes GetAttributes(IPAddress ipAddress)
{
if (IPAddress.IsLoopback(ipAddress))
return RequestAttributes.Localhost;
return IsInLocalSubnet(ipAddress)
? RequestAttributes.LocalSubnet
: RequestAttributes.External;
}
HttpRequestExtensions::GetAttributes ( this request ) : ServiceStack.Host.RequestAttributes |
public RequestAttributes GetRequestAttributes(System.ServiceModel.OperationContext operationContext) { if (!HostContext.Config.EnableAccessRestrictions) { return(default(RequestAttributes)); } var portRestrictions = default(RequestAttributes); var ipAddress = GetIpAddress(operationContext); portRestrictions |= HttpRequestExtensions.GetAttributes(ipAddress); //TODO: work out if the request was over a secure channel //portRestrictions |= request.IsSecureConnection ? PortRestriction.Secure : PortRestriction.InSecure; return(portRestrictions); }