private string GetRemoteAddr(NameValueCollection httpHeaders)
{
string retVal = GetKeyValue(httpHeaders, "REMOTE_ADDR");
//HTTP_X_FORWARDED_FOR
if (BonCodeAJP13Settings.BONCODEAJP13_REMOTEADDR_FROM != "") {
try
{
string tempVal = GetKeyValue(httpHeaders,BonCodeAJP13Settings.BONCODEAJP13_REMOTEADDR_FROM);
if (tempVal != "") retVal = tempVal.Split(new char[] { ',' })[0];
//TODO: interate through and find left most non-private address
//(Left(testIP,3) NEQ "10.") AND (Left(testIP,7) NEQ "172.16.") AND (Left(testIP,8) NEQ "192.168.")
} catch {
//we will not return an alternate value in case of error
}
}
return retVal;
}