X-Forwarded-For: verify the whole chain, from the end

This commit is contained in:
Alexey Sokolov
2013-11-14 22:22:32 +04:00
parent ccbc469168
commit 3e56f093f2
6 changed files with 59 additions and 36 deletions

View File

@@ -866,21 +866,6 @@ bool CWebSock::OnLogin(const CString& sUser, const CString& sPass) {
return IsLoggedIn();
}
CString CWebSock::GetRemoteIP()
{
const VCString& vsProxies = CZNC::Get().GetAllowProxies();
CString sIP = CHTTPSock::GetRemoteIP();
VCString::const_iterator it;
for (it = vsProxies.begin(); it != vsProxies.end(); ++it) {
if (sIP.WildCmp(*it)) {
return m_sForwardedIP;
}
}
return sIP;
}
Csock* CWebSock::GetSockObj(const CString& sHost, unsigned short uPort) {
// All listening is done by CListener, thus CWebSock should never have
// to listen, but since GetSockObj() is pure virtual...