mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 05:45:59 +03:00
Adds m_uri_no_query_string_decoded to transaction
This commit is contained in:
parent
ab88083159
commit
293a849668
@ -215,13 +215,18 @@ class Transaction {
|
||||
const char *m_serverIpAddress;
|
||||
|
||||
/**
|
||||
* Holds the raw URI that was requestd.
|
||||
* Holds the raw URI that was requested.
|
||||
*/
|
||||
const char *m_uri;
|
||||
|
||||
/**
|
||||
* Holds the URI that was requests (without the query string).
|
||||
*/
|
||||
std::string m_uri_no_query_string_decoded;
|
||||
|
||||
/**
|
||||
* Holds the combined size of all arguments, later used to fill the
|
||||
* variable ARGS_COMBINED_SIZE.
|
||||
* variable ARGS_COMBINED_SIZE.
|
||||
*/
|
||||
double m_ARGScombinedSize;
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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)));
|
||||
|
Loading…
x
Reference in New Issue
Block a user