2015-03-24 06:21:58 -04:00
|
|
|
<?php
|
2024-05-23 03:26:56 -04:00
|
|
|
|
2015-03-24 06:21:58 -04:00
|
|
|
/**
|
2024-05-23 03:26:56 -04:00
|
|
|
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
2015-03-24 06:21:58 -04:00
|
|
|
*/
|
|
|
|
|
namespace OCP\AppFramework\Http;
|
|
|
|
|
|
2023-06-14 02:56:42 -04:00
|
|
|
use OCP\AppFramework\Http;
|
|
|
|
|
|
2015-03-24 06:21:58 -04:00
|
|
|
/**
|
|
|
|
|
* A generic 404 response showing an 404 error page as well to the end-user
|
2015-04-16 11:00:08 -04:00
|
|
|
* @since 8.1.0
|
2024-12-16 10:20:48 -05:00
|
|
|
* @template S of Http::STATUS_*
|
2023-06-14 02:56:42 -04:00
|
|
|
* @template H of array<string, mixed>
|
2024-12-16 10:20:48 -05:00
|
|
|
* @template-extends TemplateResponse<Http::STATUS_*, array<string, mixed>>
|
2015-03-24 06:21:58 -04:00
|
|
|
*/
|
2020-07-24 01:53:48 -04:00
|
|
|
class NotFoundResponse extends TemplateResponse {
|
2015-04-16 11:00:08 -04:00
|
|
|
/**
|
2023-06-14 02:56:42 -04:00
|
|
|
* @param S $status
|
|
|
|
|
* @param H $headers
|
2015-04-16 11:00:08 -04:00
|
|
|
* @since 8.1.0
|
|
|
|
|
*/
|
2023-06-14 02:56:42 -04:00
|
|
|
public function __construct(int $status = Http::STATUS_NOT_FOUND, array $headers = []) {
|
|
|
|
|
parent::__construct('core', '404', [], 'guest', $status, $headers);
|
2019-04-03 12:42:34 -04:00
|
|
|
|
2019-09-09 16:37:12 -04:00
|
|
|
$this->setContentSecurityPolicy(new ContentSecurityPolicy());
|
2015-03-24 06:21:58 -04:00
|
|
|
}
|
|
|
|
|
}
|