Skip to content

Commit 530559b

Browse files
authored
Merge pull request #312 from nextcloud/master-add-ratelimit
Add ratelimit to ServerInfo API endpoint
2 parents e928e50 + 741acf6 commit 530559b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/Controller/ApiController.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,14 @@ private function checkAuthorized(): bool {
146146
* @NoCSRFRequired
147147
* @NoAdminRequired
148148
* @PublicPage
149+
* @BruteForceProtection(action=serverinfo)
149150
*
150151
* @return DataResponse
151152
*/
152153
public function info(): DataResponse {
153154
if (!$this->checkAuthorized()) {
154155
$response = new DataResponse(['message' => 'Unauthorized']);
156+
$response->throttle();
155157
$response->setStatus(Http::STATUS_UNAUTHORIZED);
156158
return $response;
157159
}

0 commit comments

Comments
 (0)