You are here

public function SecuritytxtController::securitytxtFile in Security.txt 8

Get the security.txt file as a response object.

Return value

\Symfony\Component\HttpFoundation\Response The security.txt file as a response object with a content type of 'text/plain'.

1 string reference to 'SecuritytxtController::securitytxtFile'
securitytxt.routing.yml in ./securitytxt.routing.yml
securitytxt.routing.yml

File

src/Controller/SecuritytxtController.php, line 60

Class

SecuritytxtController
Controller routines for securitytxt routes.

Namespace

Drupal\securitytxt\Controller

Code

public function securitytxtFile() {
  $content = $this->serializer
    ->getSecuritytxtFile($this->settings);
  $response = new Response($content, 200, [
    'Content-Type' => 'text/plain',
  ]);
  return $response;
}