Skip to content

Commit

Permalink
Merge pull request #27336 from nextcloud/backport/27329/stable21
Browse files Browse the repository at this point in the history
[stable21] Propagate throttling on OCS response
  • Loading branch information
MorrisJobke authored Jun 7, 2021
2 parents 5412605 + 6a6bcdc commit 4136993
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/private/AppFramework/OCS/BaseResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ public function __construct(DataResponse $dataResponse,
$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'
Expand Down

0 comments on commit 4136993

Please sign in to comment.