Add CIDR support to TrustedProxy setting

Fix #1219
This commit is contained in:
Alexey Sokolov
2016-12-25 13:00:02 +00:00
parent bd1a71cb29
commit 6fbab7b44c
7 changed files with 116 additions and 107 deletions

View File

@@ -163,7 +163,7 @@ void CHTTPSock::ReadLine(const CString& sData) {
// check if sIP is trusted proxy
bool bTrusted = false;
for (const CString& sTrustedProxy : vsTrustedProxies) {
if (sIP.WildCmp(sTrustedProxy)) {
if (CUtils::CheckCIDR(sIP, sTrustedProxy)) {
bTrusted = true;
break;
}