Skip to content

Commit 2355713

Browse files
juliusknorrbackportbot[bot]
authored andcommitted
fix: Properly throttle in error cases and add rate limit for public file creation
Signed-off-by: Julius Knorr <jus@bitgrid.net> [skip ci]
1 parent a350914 commit 2355713

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/Controller/DocumentAPIController.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,12 @@ public function create(string $mimeType, string $fileName, string $directoryPath
105105
}
106106
} catch (Throwable $e) {
107107
$this->logger->error('Failed to create document', ['exception' => $e]);
108-
return new JSONResponse([
108+
$response = new JSONResponse([
109109
'status' => 'error',
110110
'message' => $this->l10n->t('Cannot create document')
111111
], Http::STATUS_BAD_REQUEST);
112+
$response->throttle();
113+
return $response;
112114
}
113115

114116
$basename = $this->l10n->t('New Document.odt');

0 commit comments

Comments
 (0)