mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Adds support to the variables: RESPONSE{BODY,CONTENT_LENGTH,CONTENT_TYPE}
This commit is contained in:
@@ -664,6 +664,9 @@ int Assay::addResponseHeader(const std::string& key,
|
||||
|
||||
this->store_variable("RESPONSE_HEADERS:" + key, value);
|
||||
|
||||
if (tolower(key) == "content-type") {
|
||||
this->store_variable("RESPONSE_CONTENT_TYPE", value);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -748,6 +751,10 @@ int Assay::processResponseBody() {
|
||||
store_variable("OUTBOUND_DATA_ERROR", "0");
|
||||
}
|
||||
|
||||
store_variable("RESPONSE_BODY", m_responseBody.str());
|
||||
store_variable("RESPONSE_CONTENT_LENGTH",
|
||||
std::to_string(m_responseBody.str().size()));
|
||||
|
||||
this->m_rules->evaluate(ModSecurity::ResponseBodyPhase, this);
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user