We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent eeec81c commit a81280cCopy full SHA for a81280c
1 file changed
src/controllers/CartController.php
@@ -19,6 +19,7 @@
19
use craft\elements\User;
20
use craft\errors\ElementNotFoundException;
21
use craft\errors\MissingComponentException;
22
+use craft\helpers\App;
23
use craft\helpers\Json;
24
use craft\helpers\StringHelper;
25
use craft\helpers\UrlHelper;
@@ -95,7 +96,7 @@ public function behaviors(): array
95
96
'cart-by-number' => [
97
'class' => RateLimit::class,
98
'limit' => 1,
- 'window' => 1,
99
+ 'window' => (float)App::env('CRAFT_COMMERCE_CART_RATE_LIMIT_WINDOW') ?: 0.5,
100
// Only apply rate limiting when a cart number is explicitly passed
101
'active' => function(Context $context, $rateLimitId) {
102
return $context->request->getBodyParam('number') || $context->request->getQueryParam('number');
0 commit comments