mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 05:45:59 +03:00
Merge pull request #3298 from airween/v3/sethostnamefix
Fix m_requestHostName variable behavior
This commit is contained in:
commit
41fd21b0fb
@ -227,7 +227,9 @@ int Transaction::processConnection(const char *client, int cPort,
|
|||||||
const char *server, int sPort) {
|
const char *server, int sPort) {
|
||||||
m_clientIpAddress = client;
|
m_clientIpAddress = client;
|
||||||
m_serverIpAddress = server;
|
m_serverIpAddress = server;
|
||||||
m_requestHostName = server;
|
if (m_requestHostName.empty() == true) {
|
||||||
|
m_requestHostName = server;
|
||||||
|
}
|
||||||
this->m_clientPort = cPort;
|
this->m_clientPort = cPort;
|
||||||
this->m_serverPort = sPort;
|
this->m_serverPort = sPort;
|
||||||
ms_dbg(4, "Transaction context created.");
|
ms_dbg(4, "Transaction context created.");
|
||||||
|
@ -269,15 +269,15 @@ void perform_unit_test(const ModSecurityTest<RegressionTest> &test,
|
|||||||
|
|
||||||
auto modsec_transaction = context.create_transaction();
|
auto modsec_transaction = context.create_transaction();
|
||||||
|
|
||||||
|
if (t->hostname != "") {
|
||||||
|
modsec_transaction.setRequestHostName(t->hostname);
|
||||||
|
}
|
||||||
|
|
||||||
clearAuditLog(modsec_transaction.m_rules->m_auditLog->m_path1);
|
clearAuditLog(modsec_transaction.m_rules->m_auditLog->m_path1);
|
||||||
|
|
||||||
modsec_transaction.processConnection(t->clientIp.c_str(),
|
modsec_transaction.processConnection(t->clientIp.c_str(),
|
||||||
t->clientPort, t->serverIp.c_str(), t->serverPort);
|
t->clientPort, t->serverIp.c_str(), t->serverPort);
|
||||||
|
|
||||||
if (t->hostname != "") {
|
|
||||||
modsec_transaction.setRequestHostName(t->hostname);
|
|
||||||
}
|
|
||||||
|
|
||||||
actions(&r, &modsec_transaction, &context.m_server_log);
|
actions(&r, &modsec_transaction, &context.m_server_log);
|
||||||
|
|
||||||
modsec_transaction.processURI(t->uri.c_str(), t->method.c_str(),
|
modsec_transaction.processURI(t->uri.c_str(), t->method.c_str(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user