Fill PATH_INFO with decoded value

This commit is contained in:
Felipe Zimmerle 2015-08-10 12:40:46 -03:00
parent 9431678f89
commit 9231f507bf
2 changed files with 11 additions and 8 deletions

View File

@ -244,14 +244,17 @@ int Assay::processURI(const char *uri, const char *protocol,
store_variable("REQUEST_LINE", std::string(protocol) + " " +
std::string(uri) + " HTTP/" + std::string(http_version));
std::string path_info;
if (pos_raw == std::string::npos) {
path_info = std::string(uri_s, 0);
} else {
path_info = std::string(uri_s, 0, pos_raw);
if (pos_raw != std::string::npos) {
store_variable("QUERY_STRING", std::string(uri_s, pos_raw + 1,
uri_s.length() - (pos_raw + 1)));
}
std::string path_info;
if (pos == std::string::npos) {
path_info = std::string(m_uri_decoded, 0);
} else {
path_info = std::string(m_uri_decoded, 0, pos);
}
store_variable("PATH_INFO", path_info);
store_variable("REQUEST_FILENAME", path_info);

View File

@ -2,7 +2,7 @@
{
"enabled":1,
"version_min":300000,
"title":"Testing Variables :: PATH_INFO",
"title":"Testing Variables :: PATH_INFO (1/3)",
"client":{
"ip":"200.249.12.31",
"port":123
@ -48,7 +48,7 @@
{
"enabled":1,
"version_min":300000,
"title":"Testing Variables :: PATH_INFO",
"title":"Testing Variables :: PATH_INFO (2/3)",
"client":{
"ip":"200.249.12.31",
"port":123
@ -94,7 +94,7 @@
{
"enabled":1,
"version_min":300000,
"title":"Testing Variables :: PATH_INFO",
"title":"Testing Variables :: PATH_INFO (3/3)",
"client":{
"ip":"200.249.12.31",
"port":123