diff --git a/Makefile.am b/Makefile.am index b8286ef2..a7625a7e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 diff --git a/src/transaction.cc b/src/transaction.cc index 9b3416da..31c57a53 100644 --- a/src/transaction.cc +++ b/src/transaction.cc @@ -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;