diff options
Diffstat (limited to 'lib/public/AppFramework/Http/TooManyRequestsResponse.php')
-rw-r--r-- | lib/public/AppFramework/Http/TooManyRequestsResponse.php | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/public/AppFramework/Http/TooManyRequestsResponse.php b/lib/public/AppFramework/Http/TooManyRequestsResponse.php index caf565ee954..043ae0161e9 100644 --- a/lib/public/AppFramework/Http/TooManyRequestsResponse.php +++ b/lib/public/AppFramework/Http/TooManyRequestsResponse.php @@ -6,6 +6,7 @@ declare(strict_types=1); * @copyright Copyright (c) 2020 Joas Schilling <coding@schilljs.com> * * @author Joas Schilling <coding@schilljs.com> + * @author Kate Döen <kate.doeen@nextcloud.com> * * @license GNU AGPL version 3 or any later version * @@ -26,20 +27,25 @@ declare(strict_types=1); namespace OCP\AppFramework\Http; use OCP\Template; +use OCP\AppFramework\Http; /** * A generic 429 response showing an 404 error page as well to the end-user * @since 19.0.0 + * @template S of int + * @template H of array<string, mixed> + * @template-extends Response<int, array<string, mixed>> */ class TooManyRequestsResponse extends Response { /** + * @param S $status + * @param H $headers * @since 19.0.0 */ - public function __construct() { - parent::__construct(); + public function __construct(int $status = Http::STATUS_TOO_MANY_REQUESTS, array $headers = []) { + parent::__construct($status, $headers); $this->setContentSecurityPolicy(new ContentSecurityPolicy()); - $this->setStatus(429); } /** |