Adds support to m_highlightJSON in RuleMessage class

This variable helds a JSON with information regarding all matches.
Only filled when IncludeFullHighlightLog property is set.
This commit is contained in:
Felipe Zimmerle
2018-10-11 10:00:59 -03:00
parent eec95cfe17
commit e83f66ee49
6 changed files with 13 additions and 3 deletions

View File

@@ -207,6 +207,8 @@ void ModSecurity::serverLog(void *data, std::shared_ptr<RuleMessage> rm) {
if (m_logProperties & RuleMessageLogProperty) {
const void *a = static_cast<const void *>(rm.get());
if (m_logProperties & IncludeFullHighlightLogProperty) {
processContentOffset(rm->m_buf.c_str(), rm->m_buf.size(),
rm->m_reference.c_str(), &rm->m_highlightJSON, NULL);
m_logCb(data, a);
return;
}

View File

@@ -93,7 +93,10 @@ std::string RuleMessage::log(const RuleMessage *rm, int props, int code) {
return modsecurity::utils::string::toHexIfNeeded(msg);
}
/*
* Depricated. Do not use. Should be removed before merge.
*
*/
RuleMessageHighlight RuleMessage::computeHighlight(const RuleMessage *rm,
const std::string buf) {
RuleMessageHighlight ret;