From c98be42f8f6866a2d04ac64bfb21acca530622cf Mon Sep 17 00:00:00 2001 From: Felipe Zimmerle Date: Wed, 16 Nov 2016 11:00:10 -0300 Subject: [PATCH] Limits the transformation output to 80 chars in the debug logs --- src/rule.cc | 6 ++++-- test/test-cases/regression/variable-FULL_REQUEST.json | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/rule.cc b/src/rule.cc index 0bb308cb..ae5344b5 100644 --- a/src/rule.cc +++ b/src/rule.cc @@ -408,7 +408,8 @@ bool Rule::evaluate(Transaction *trasn) { #ifndef NO_LOGS trasn->debug(9, "(SecDefaultAction) T (" + \ std::to_string(transformations) + ") " + \ - a->m_name + ": \"" + value +"\""); + a->m_name + ": \"" + \ + utils::string::limitTo(80, value) +"\""); #endif transformations++; } @@ -421,7 +422,8 @@ bool Rule::evaluate(Transaction *trasn) { #ifndef NO_LOGS trasn->debug(9, " T (" + \ std::to_string(transformations) + ") " + \ - a->m_name + ": \"" + value +"\""); + a->m_name + ": \"" + \ + utils::string::limitTo(80, value) + "\""); #endif transformations++; } diff --git a/test/test-cases/regression/variable-FULL_REQUEST.json b/test/test-cases/regression/variable-FULL_REQUEST.json index caf612db..ed426167 100644 --- a/test/test-cases/regression/variable-FULL_REQUEST.json +++ b/test/test-cases/regression/variable-FULL_REQUEST.json @@ -51,7 +51,7 @@ ] }, "expected":{ - "debug_log":"Content-Type: multipart/form-data; boundary=--------------------------756b6d74fa1a8ee2" + "debug_log":"Expect: 100-continue\\x0aContent-Type: multipart/form-data; boundary=------------" }, "rules":[ "SecRuleEngine On",