Skip to content

Commit c8dcab8

Browse files
authored
Merge pull request #689 from favicode/fix/rate-limiting
Rate limiting improvement
2 parents 775b5a1 + 8a3ea3e commit c8dcab8

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

.github/workflows/code_quality.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,6 @@ jobs:
8989
php: "8.2"
9090
composer: "v2"
9191
opensearch: "2.5.0"
92-
93-
- magento: "2.4.6"
94-
php: "8.3"
95-
composer: "v2"
96-
opensearch: "2.5.0"
97-
9892
steps:
9993
- name: Setup PHP
10094
uses: shivammathur/setup-php@v2

Model/FrontControllerPlugin.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public function aroundDispatch(FrontControllerInterface $subject, callable $proc
135135
return $proceed(...$args);
136136
}
137137

138-
$path = strtolower($this->request->getPathInfo());
138+
$path = strtolower($this->request->getRequestUri());
139139

140140
if ($isRateLimitingEnabled && $this->sensitivePathProtection($path)) {
141141
return $this->response;
@@ -167,7 +167,8 @@ private function sensitivePathProtection($path)
167167

168168
$limit = false;
169169
foreach ($limitedPaths as $key => $value) {
170-
if (preg_match('{' . $value->path . '}i', $path) == 1) {
170+
$value->path = str_replace("#", "\#", $value->path);
171+
if (preg_match('#' . $value->path . '#i', $path)) {
171172
$limit = true;
172173
break;
173174
}

0 commit comments

Comments
 (0)