Adds support to the variables: RESPONSE{BODY,CONTENT_LENGTH,CONTENT_TYPE}

This commit is contained in:
Felipe Zimmerle
2015-07-22 02:18:02 -03:00
parent ec34f676c6
commit ae81bb1433
4 changed files with 142 additions and 0 deletions

View File

@@ -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;
}