mirror of
https://github.com/openappsec/openappsec.git
synced 2025-06-28 16:41:02 +03:00
Fix rate limit string handling
This commit is contained in:
parent
596033391b
commit
d91a1c4ca5
@ -114,7 +114,7 @@ public:
|
||||
}
|
||||
|
||||
string application_uri = maybe_uri.unpack();
|
||||
if (application_uri.back() == '/') application_uri.pop_back();
|
||||
if (!application_uri.empty() && application_uri.back() == '/') application_uri.pop_back();
|
||||
|
||||
for (const auto &rule : rate_limit_config.getRateLimitRules()) {
|
||||
string full_rule_uri = application_uri + rule.getRateLimitUri();
|
||||
@ -227,7 +227,7 @@ public:
|
||||
<< " seconds";
|
||||
|
||||
string unique_key = asset_id + ":" + source_identifier + ":" + uri;
|
||||
if (unique_key.back() == '/') unique_key.pop_back();
|
||||
if (!unique_key.empty() && unique_key.back() == '/') unique_key.pop_back();
|
||||
|
||||
auto verdict = decide(unique_key);
|
||||
if (verdict == RateLimitVedict::ACCEPT) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user