mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-13 21:36:00 +03:00
Removes slash from REQUEST_BASENAME
This commit is contained in:
parent
293a849668
commit
d3a4ec760c
@ -406,9 +406,9 @@ int Transaction::processURI(const char *uri, const char *method,
|
||||
m_collections.store("REQUEST_FILENAME", path_info);
|
||||
|
||||
size_t offset = path_info.find_last_of("/\\");
|
||||
if (offset != std::string::npos) {
|
||||
std::string basename = std::string(path_info, offset,
|
||||
path_info.length() - offset);
|
||||
if (offset != std::string::npos && path_info.length() > offset + 1) {
|
||||
std::string basename = std::string(path_info, offset + 1,
|
||||
path_info.length() - (offset + 1));
|
||||
m_collections.store("REQUEST_BASENAME", basename);
|
||||
}
|
||||
m_collections.store("REQUEST_METHOD", method);
|
||||
|
@ -33,7 +33,7 @@
|
||||
]
|
||||
},
|
||||
"expected":{
|
||||
"debug_log":"Target value: \"/login.php\" \\(Variable: REQUEST_BASENAME\\)"
|
||||
"debug_log":"Target value: \"login.php\" \\(Variable: REQUEST_BASENAME\\)"
|
||||
},
|
||||
"rules":[
|
||||
"SecRuleEngine On",
|
||||
|
Loading…
x
Reference in New Issue
Block a user