Implements the support to fill the REQBODY_PROCESSOR variable

This commit is contained in:
Felipe Zimmerle 2016-06-16 15:26:52 -03:00
parent 734f63bd07
commit 7cb27eb9fc
No known key found for this signature in database
GPG Key ID: E6DFB08CE8B11277
2 changed files with 5 additions and 0 deletions

View File

@ -214,3 +214,4 @@ TESTS+=test/test-cases/secrules-language-tests/operators/ipMatch.json
TESTS+=test/test-cases/secrules-language-tests/operators/strmatch.json
TESTS+=test/test-cases/secrules-language-tests/operators/detectXSS.json
TESTS+=test/test-cases/secrules-language-tests/operators/eq.json
TESTS+=test/test-cases/regression/variable-REQBODY_PROCESSOR.json

View File

@ -478,14 +478,18 @@ int Transaction::addRequestHeader(const std::string& key,
std::string l = tolower(value);
if (l.compare(0, multipart.length(), multipart) == 0) {
this->m_requestBodyType = MultiPartRequestBody;
m_collections.store("REQBODY_PROCESSOR", "MULTIPART");
}
if (l == "application/x-www-form-urlencoded") {
this->m_requestBodyType = WWWFormUrlEncoded;
m_collections.store("REQBODY_PROCESSOR", "URLENCODED");
}
if (l == "text/xml") {
// FIXME: this should be set by ctl:requestBodyProcessor.
this->m_requestBodyType = XMLRequestBody;
m_collections.store("REQBODY_PROCESSOR", "XML");
}
}
return 1;