Propagate throttling on OCS response

The BaseResponse converter did not take over any throttling state from the DataResponse.

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
This commit is contained in:
Lukas Reschke 2021-06-01 14:15:23 +02:00
parent 94f475686c
commit 09abcfadfa
1 changed files with 5 additions and 0 deletions

View File

@ -75,6 +75,11 @@ abstract class BaseResponse extends Response {
$this->setLastModified($dataResponse->getLastModified());
$this->setCookies($dataResponse->getCookies());
if ($dataResponse->isThrottled()) {
$throttleMetadata = $dataResponse->getThrottleMetadata();
$this->throttle($throttleMetadata);
}
if ($format === 'json') {
$this->addHeader(
'Content-Type', 'application/json; charset=utf-8'