mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 05:45:59 +03:00
Fill PATH_INFO with decoded value
This commit is contained in:
parent
9431678f89
commit
9231f507bf
13
src/assay.cc
13
src/assay.cc
@ -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);
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user