Skip to content

Commit 34e8b14

Browse files
author
Felipe Zimmerle
committed
Setting http response code on the auditlog
1 parent 274f9e5 commit 34e8b14

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

CHANGES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
v3.0.????? - ?
33
---------------------------
44

5+
- Setting http response code on the auditlog.
6+
[Issue #1592 - @zimmerle]
57
- Refactoring on RuleMessage class, now accepting http code as parameter.
68
[@zimmerle]
79
- Having disruptive msgs as disruptive [instead of warnings] on audit log

headers/modsecurity/rule_message.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ class RuleMessage {
7272
std::string log(int props) {
7373
return RuleMessage::log(this, props);
7474
}
75+
std::string log(int props, int responseCode) {
76+
return RuleMessage::log(this, props, responseCode);
77+
}
7578
std::string errorLog() {
7679
return RuleMessage::log(this, ClientLogMessageInfo | ErrorLogTailLogMessageInfo);
7780
}

src/transaction.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1485,7 +1485,7 @@ std::string Transaction::toOldAuditLogFormat(int parts,
14851485
if (parts & audit_log::AuditLog::HAuditLogPart) {
14861486
audit_log << "--" << trailer << "-" << "H--" << std::endl;
14871487
for (auto a : m_rulesMessages) {
1488-
audit_log << a.log() << std::endl;
1488+
audit_log << a.log(0, m_httpCodeReturned) << std::endl;
14891489
}
14901490
audit_log << std::endl;
14911491
/** TODO: write audit_log H part. */

0 commit comments

Comments
 (0)