mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
API CHANGE: response status is now set on processResponseHeaders
That change was needed to move the variable attribution to earliest as possible. We also have a new field for HTTP_PROTOCOL version used on the response.
This commit is contained in:
@@ -147,7 +147,7 @@ int main(int argc, char *argv[]) {
|
||||
modsecTransaction->addResponseHeader("Content-Length",
|
||||
"200");
|
||||
|
||||
modsecTransaction->processResponseHeaders();
|
||||
modsecTransaction->processResponseHeaders(200, "HTTP 1.2");
|
||||
|
||||
if (modsecTransaction->intervention(&it)) {
|
||||
std::cout << "There is an intervention" << std::endl;
|
||||
@@ -165,7 +165,7 @@ int main(int argc, char *argv[]) {
|
||||
}
|
||||
|
||||
next_request:
|
||||
modsecTransaction->processLogging(200);
|
||||
modsecTransaction->processLogging();
|
||||
delete modsecTransaction;
|
||||
}
|
||||
|
||||
|
@@ -246,17 +246,21 @@ void perform_unit_test(ModSecurityTest<RegressionTest> *test,
|
||||
t->clientPort, t->serverIp.c_str(), t->serverPort);
|
||||
|
||||
actions(&r, modsec_transaction);
|
||||
#if 0
|
||||
if (r.status != 200) {
|
||||
goto end;
|
||||
}
|
||||
#endif
|
||||
|
||||
modsec_transaction->processURI(t->uri.c_str(), t->method.c_str(),
|
||||
t->httpVersion.c_str());
|
||||
|
||||
actions(&r, modsec_transaction);
|
||||
#if 0
|
||||
if (r.status != 200) {
|
||||
goto end;
|
||||
}
|
||||
#endif
|
||||
|
||||
for (std::pair<std::string, std::string> headers :
|
||||
t->request_headers) {
|
||||
@@ -267,7 +271,7 @@ void perform_unit_test(ModSecurityTest<RegressionTest> *test,
|
||||
modsec_transaction->processRequestHeaders();
|
||||
actions(&r, modsec_transaction);
|
||||
if (r.status != 200) {
|
||||
goto end;
|
||||
//goto end;
|
||||
}
|
||||
|
||||
modsec_transaction->appendRequestBody(
|
||||
@@ -275,9 +279,11 @@ void perform_unit_test(ModSecurityTest<RegressionTest> *test,
|
||||
t->request_body.size());
|
||||
modsec_transaction->processRequestBody();
|
||||
actions(&r, modsec_transaction);
|
||||
#if 0
|
||||
if (r.status != 200) {
|
||||
goto end;
|
||||
}
|
||||
#endif
|
||||
|
||||
for (std::pair<std::string, std::string> headers :
|
||||
t->response_headers) {
|
||||
@@ -285,23 +291,27 @@ void perform_unit_test(ModSecurityTest<RegressionTest> *test,
|
||||
headers.second.c_str());
|
||||
}
|
||||
|
||||
modsec_transaction->processResponseHeaders();
|
||||
modsec_transaction->processResponseHeaders(r.status, "HTTP 1.1");
|
||||
actions(&r, modsec_transaction);
|
||||
#if 0
|
||||
if (r.status != 200) {
|
||||
goto end;
|
||||
}
|
||||
#endif
|
||||
|
||||
modsec_transaction->appendResponseBody(
|
||||
(unsigned char *)t->response_body.c_str(),
|
||||
t->response_body.size());
|
||||
modsec_transaction->processResponseBody();
|
||||
actions(&r, modsec_transaction);
|
||||
#if 0
|
||||
if (r.status != 200) {
|
||||
goto end;
|
||||
}
|
||||
#endif
|
||||
|
||||
end:
|
||||
modsec_transaction->processLogging(r.status);
|
||||
modsec_transaction->processLogging();
|
||||
|
||||
CustomDebugLog *d = reinterpret_cast<CustomDebugLog *>
|
||||
(modsec_rules->m_debugLog);
|
||||
|
Reference in New Issue
Block a user