. */ declare(strict_types=1); namespace Fisharebest\Webtrees\Http\RequestHandlers; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Server\RequestHandlerInterface; use function file_get_contents; use function response; /** * Respond to /favicon.ico. */ class FaviconIco implements RequestHandlerInterface { /** * @param ServerRequestInterface $request * * @return ResponseInterface */ public function handle(ServerRequestInterface $request): ResponseInterface { $content = file_get_contents(__DIR__ . '/../../../favicon.ico'); return response($content) ->withHeader('content-type', 'image/x-icon') ->withHeader('cache-control', 'public,max-age=31536000'); } }