Skip to content

Commit 3f55468

Browse files
committed
AC-1271: Add rate limiting for payment information endpoint and mutation
1 parent 18b3be5 commit 3f55468

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

app/code/Magento/Webapi/Controller/Rest/RequestValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ private function checkBackpressure(Route $route)
146146
$this->backpressureEnforcer->enforce($context);
147147
} catch (BackpressureExceededException $exception) {
148148
throw new WebapiException(
149-
__('Something went wrong, please try again later'),
149+
__('Too Many Requests'),
150150
0,
151151
WebapiException::HTTP_TOO_MANY_REQUESTS
152152
);

app/code/Magento/Webapi/Controller/Soap/Request/Handler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ private function backpressureEnforcement(string $class, string $method, string $
300300
$this->backpressureEnforcer->enforce($context);
301301
} catch (BackpressureExceededException $exception) {
302302
throw new WebapiException(
303-
__('Something went wrong, please try again later'),
303+
__('Too Many Requests'),
304304
0,
305305
WebapiException::HTTP_TOO_MANY_REQUESTS
306306
);

app/code/Magento/Webapi/i18n/en_US.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ Message,Message
2222
"If empty, UTF-8 will be used.","If empty, UTF-8 will be used."
2323
"Web Services Configuration","Web Services Configuration"
2424
"REST and SOAP configurations, generated WSDL file","REST and SOAP configurations, generated WSDL file"
25-
"Something went wrong, please try again later","Something went wrong, please try again later"
25+
"Too Many Requests","Too Many Requests"

lib/internal/Magento/Framework/App/Request/BackpressureValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function validate(RequestInterface $request, ActionInterface $action): vo
6868
try {
6969
$this->enforcer->enforce($context);
7070
} catch (BackpressureExceededException $exception) {
71-
throw new LocalizedException(__('Something went wrong, please try again later'), $exception);
71+
throw new LocalizedException(__('Too Many Requests'), $exception);
7272
}
7373
}
7474
}

0 commit comments

Comments
 (0)