Merge pull request #27329 from nextcloud/propagate-throttle-state-for-baseresponse

Propagate throttling on OCS response
This commit is contained in:
Lukas Reschke 2021-06-01 21:40:41 +02:00 committed by GitHub
commit 5438e00276
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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'