Merge pull request #26970 from nextcloud/backport/26958/stable19

[stable19] Throttle MountPublicLinkController when share is not found
This commit is contained in:
Roeland Jago Douma 2021-05-14 10:55:29 +02:00 committed by GitHub
commit 633200df4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -142,7 +142,9 @@ class MountPublicLinkController extends Controller {
list(, $server) = $this->addressHandler->splitUserRemote($shareWith);
$share = $this->shareManager->getShareByToken($token);
} catch (HintException $e) {
return new JSONResponse(['message' => $e->getHint()], Http::STATUS_BAD_REQUEST);
$response = new JSONResponse(['message' => $e->getHint()], Http::STATUS_BAD_REQUEST);
$response->throttle();
return $response;
}
// make sure that user is authenticated in case of a password protected link