Adds m_uri_no_query_string_decoded to transaction

This commit is contained in:
Felipe Zimmerle
2016-11-22 15:14:39 -03:00
parent ab88083159
commit 293a849668
3 changed files with 15 additions and 3 deletions

View File

@@ -45,7 +45,7 @@ std::string RuleMessage::errorLog(Transaction *trans) {
}
msg.append(" [hostname \"" + std::string(trans->m_serverIpAddress) \
+ "\"]");
msg.append(" [uri \"" + std::string(trans->m_uri) + "\"]");
msg.append(" [uri \"" + trans->m_uri_no_query_string_decoded + "\"]");
msg.append(" [unique_id \"" + trans->m_id + "\"]");
return modsecurity::utils::string::toHexIfNeeded(msg);

View File

@@ -102,6 +102,7 @@ Transaction::Transaction(ModSecurity *ms, Rules *rules, void *logCbData)
m_clientPort(0),
m_serverPort(0),
m_uri(""),
m_uri_no_query_string_decoded(""),
m_method(""),
m_httpVersion(""),
m_rules(rules),
@@ -384,6 +385,12 @@ int Transaction::processURI(const char *uri, const char *method,
m_collections.store("REQUEST_LINE", std::string(method) + " " +
std::string(uri) + " HTTP/" + std::string(http_version));
if (pos != std::string::npos) {
m_uri_no_query_string_decoded = std::string(m_uri_decoded, 0, pos);
} else {
m_uri_no_query_string_decoded = std::string(m_uri_decoded);
}
if (pos_raw != std::string::npos) {
m_collections.store("QUERY_STRING", std::string(uri_s, pos_raw + 1,
uri_s.length() - (pos_raw + 1)));