f7cloud_client/apps/settings/lib/WellKnown/SecurityTxtHandler.php
root 8b6a0139db f7cloud_client
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-17 22:59:26 +00:00

35 lines
981 B
PHP

<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2021 F7cloud GmbH and F7cloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\Settings\WellKnown;
use OCP\AppFramework\Http\TextPlainResponse;
use OCP\Http\WellKnown\GenericResponse;
use OCP\Http\WellKnown\IHandler;
use OCP\Http\WellKnown\IRequestContext;
use OCP\Http\WellKnown\IResponse;
class SecurityTxtHandler implements IHandler {
public function handle(string $service, IRequestContext $context, ?IResponse $previousResponse): ?IResponse {
if ($service !== 'security.txt') {
return $previousResponse;
}
$response = 'Contact: https://hackerone.com/f7cloud
Expires: 2026-04-30T23:00:00.000Z
Acknowledgments: https://hackerone.com/f7cloud/thanks
Acknowledgments: https://github.com/f7cloud/security-advisories/security/advisories
Policy: https://hackerone.com/f7cloud
Preferred-Languages: en
';
return new GenericResponse(new TextPlainResponse($response, 200));
}
}