mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-16 07:56:12 +03:00
Changes the line terminator to fixed value: \n
\r is no longer take into consideration
This commit is contained in:
parent
cc897b0c44
commit
f06d09dd49
@ -21,6 +21,9 @@
|
|||||||
#include "examples/reading_logs_via_rule_message/reading_logs_via_rule_message.h"
|
#include "examples/reading_logs_via_rule_message/reading_logs_via_rule_message.h"
|
||||||
|
|
||||||
|
|
||||||
|
char request_uri2[] = "/index.html?d=1";
|
||||||
|
|
||||||
|
std::unordered_multimap<std::string, std::string> requestHeaders;
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
if (argc < 2) {
|
if (argc < 2) {
|
||||||
@ -29,9 +32,12 @@ int main(int argc, char **argv) {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
*(argv++);
|
requestHeaders.emplace("Host", "SITE2");
|
||||||
|
requestHeaders.emplace("User-Agent", "wFetch");
|
||||||
|
requestHeaders.emplace("test", "21321");
|
||||||
|
|
||||||
std::string rules(*argv);
|
std::string rules(*argv);
|
||||||
ReadingLogsViaRuleMessage rlvrm(request_header, request_uri, request_body,
|
ReadingLogsViaRuleMessage rlvrm(requestHeaders, request_uri, request_body,
|
||||||
"", response_body, ip, rules);
|
"", response_body, ip, rules);
|
||||||
rlvrm.process();
|
rlvrm.process();
|
||||||
|
|
||||||
|
@ -1523,7 +1523,7 @@ std::string Transaction::toBuf() {
|
|||||||
a.append(m_uri);
|
a.append(m_uri);
|
||||||
a.append(" HTTP/");
|
a.append(" HTTP/");
|
||||||
a.append(m_httpVersion);
|
a.append(m_httpVersion);
|
||||||
a.append("\r\n");
|
a.append("\n");
|
||||||
std::vector<const collection::Variable *> l;
|
std::vector<const collection::Variable *> l;
|
||||||
m_variableRequestHeaders.resolve(&l);
|
m_variableRequestHeaders.resolve(&l);
|
||||||
for (auto h : l) {
|
for (auto h : l) {
|
||||||
@ -1531,13 +1531,13 @@ std::string Transaction::toBuf() {
|
|||||||
a.append((h->m_key.c_str() + pos));
|
a.append((h->m_key.c_str() + pos));
|
||||||
a.append(": ");
|
a.append(": ");
|
||||||
a.append((h->m_value.c_str()));
|
a.append((h->m_value.c_str()));
|
||||||
a.append("\r\n");
|
a.append("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
a.append("\r\n\r\n");
|
a.append("\n\n");
|
||||||
if (this->m_requestBody.str().length() > 0) {
|
if (this->m_requestBody.str().length() > 0) {
|
||||||
a.append(this->m_requestBody.str().c_str());
|
a.append(this->m_requestBody.str().c_str());
|
||||||
a.append("\r\n\r\n");
|
a.append("\n\n");
|
||||||
}
|
}
|
||||||
#if 0
|
#if 0
|
||||||
l.clear();
|
l.clear();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user