mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-11-18 10:20:35 +03:00
Improves rules dump for better testing
This commit is contained in:
@@ -30,6 +30,8 @@
|
||||
#include "modsecurity/variable_value.h"
|
||||
#include "modsecurity/rule.h"
|
||||
#include "src/rule_with_actions.h"
|
||||
#include "src/variables/variable.h"
|
||||
#include "src/operators/operator.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -80,6 +82,15 @@ class RuleWithOperator : public RuleWithActions {
|
||||
return std::to_string(getId());
|
||||
}
|
||||
|
||||
virtual void dump(std::stringstream &out) override {
|
||||
Rule::dump(out);
|
||||
out << "# RuleWithOperator" << std::endl;
|
||||
out << "SecRule ";
|
||||
out << m_variables->getVariableNames() << " ";
|
||||
out << "\"" << "@" << m_operator->m_op << " " << m_operator->m_param << "\"";
|
||||
out << std::endl;
|
||||
}
|
||||
|
||||
private:
|
||||
std::shared_ptr<modsecurity::variables::Variables> m_variables;
|
||||
std::shared_ptr<operators::Operator> m_operator;
|
||||
|
||||
Reference in New Issue
Block a user