Whitelisted X-Forwarded-For header support

This commit is contained in:
Siyo
2013-05-10 14:19:58 +02:00
parent a3c0b74ffc
commit 3d5ba6af3e
6 changed files with 67 additions and 0 deletions
+3
View File
@@ -113,6 +113,9 @@ void CHTTPSock::ReadLine(const CString& sData) {
m_uPostLen = sLine.Token(1).ToULong();
if (m_uPostLen > MAX_POST_SIZE)
PrintErrorPage(413, "Request Entity Too Large", "The request you sent was too large.");
} else if (sName.Equals("X-Forwarded-For:")) {
CString sIP = sLine.Token(1, false);
m_sForwardedIP = sIP.TrimRight_n(", ");
} else if (sName.Equals("If-None-Match:")) {
// this is for proper client cache support (HTTP 304) on static files:
m_sIfNoneMatch = sLine.Token(1, true);