Refactoring on the variable read/store methods

Now it is ready to received two (or more) variables with same key.
This commit is contained in:
Felipe Zimmerle
2015-07-14 00:25:59 -03:00
parent f13a1bd880
commit 80f13437e3
6 changed files with 59 additions and 37 deletions

View File

@@ -21,6 +21,7 @@
#include <string>
#include <sstream>
#include <unordered_map>
#include <map>
#include <fstream>
#include <vector>
#endif
@@ -91,7 +92,7 @@ class ModSecurityCollectionsVariables :
class ModSecurityStringVariables :
public std::unordered_map<std::string, std::string> {
public std::unordered_multimap<std::string, std::string> {
public:
};
@@ -135,11 +136,10 @@ class Assay {
const char *getResponseBody();
int getResponseBodyLenth();
std::string resolve_variable(std::string);
std::list<std::string> resolve_variable(std::string var);
std::string* resolve_variable_first(std::string);
void store_variable(std::string, std::string);
void store_variable(std::string,
std::unordered_map<std::string, std::string>);
ModSecurityStringVariables m_variables_strings;
@@ -172,6 +172,9 @@ class Assay {
const char *m_protocol;
const char *m_httpVersion;
std::string m_namesResponse;
std::string m_namesRequest;
std::ostringstream m_requestBody;
std::ostringstream m_responseBody;
ModSecurityCollectionsVariables m_variables_collections;