mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-30 19:47:47 +03:00
Changes debuglogs schema to avoid unecessary str allocation
This commit is contained in:
@@ -82,28 +82,22 @@ bool ValidateUrlEncoding::evaluate(Transaction *transaction, Rule *rule,
|
||||
case 1 :
|
||||
/* Encoding is valid */
|
||||
if (transaction) {
|
||||
#ifndef NO_LOGS
|
||||
transaction->debug(7, "Valid URL Encoding at '" +input + "'");
|
||||
#endif
|
||||
ms_dbg_a(transaction, 7, "Valid URL Encoding at '" +input + "'");
|
||||
}
|
||||
res = false;
|
||||
break;
|
||||
case -2 :
|
||||
if (transaction) {
|
||||
#ifndef NO_LOGS
|
||||
transaction->debug(7, "Invalid URL Encoding: Non-hexadecimal "
|
||||
ms_dbg_a(transaction, 7, "Invalid URL Encoding: Non-hexadecimal "
|
||||
"digits used at '" + input + "'");
|
||||
#endif
|
||||
logOffset(ruleMessage, offset, input.size());
|
||||
}
|
||||
res = true; /* Invalid match. */
|
||||
break;
|
||||
case -3 :
|
||||
if (transaction) {
|
||||
#ifndef NO_LOGS
|
||||
transaction->debug(7, "Invalid URL Encoding: Not enough " \
|
||||
ms_dbg_a(transaction, 7, "Invalid URL Encoding: Not enough " \
|
||||
"characters at the end of input at '" + input + "'");
|
||||
#endif
|
||||
logOffset(ruleMessage, offset, input.size());
|
||||
}
|
||||
res = true; /* Invalid match. */
|
||||
@@ -111,11 +105,9 @@ bool ValidateUrlEncoding::evaluate(Transaction *transaction, Rule *rule,
|
||||
case -1 :
|
||||
default :
|
||||
if (transaction) {
|
||||
#ifndef NO_LOGS
|
||||
transaction->debug(7, "Invalid URL Encoding: Internal " \
|
||||
ms_dbg_a(transaction, 7, "Invalid URL Encoding: Internal " \
|
||||
"Error (rc = " + std::to_string(rc) + ") at '" +
|
||||
input + "'");
|
||||
#endif
|
||||
logOffset(ruleMessage, offset, input.size());
|
||||
}
|
||||
res = true;
|
||||
|
Reference in New Issue
Block a user