xref: /webtrees/app/Http/RequestHandlers/BrowserconfigXml.php (revision d11be7027e34e3121be11cc025421873364403f9)
1d36fce8cSGreg Roach<?php
2d36fce8cSGreg Roach
3d36fce8cSGreg Roach/**
4d36fce8cSGreg Roach * webtrees: online genealogy
5*d11be702SGreg Roach * Copyright (C) 2023 webtrees development team
6d36fce8cSGreg Roach * This program is free software: you can redistribute it and/or modify
7d36fce8cSGreg Roach * it under the terms of the GNU General Public License as published by
8d36fce8cSGreg Roach * the Free Software Foundation, either version 3 of the License, or
9d36fce8cSGreg Roach * (at your option) any later version.
10d36fce8cSGreg Roach * This program is distributed in the hope that it will be useful,
11d36fce8cSGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of
12d36fce8cSGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13d36fce8cSGreg Roach * GNU General Public License for more details.
14d36fce8cSGreg Roach * You should have received a copy of the GNU General Public License
15d36fce8cSGreg Roach * along with this program. If not, see <https://www.gnu.org/licenses/>.
16d36fce8cSGreg Roach */
17d36fce8cSGreg Roach
18d36fce8cSGreg Roachdeclare(strict_types=1);
19d36fce8cSGreg Roach
20d36fce8cSGreg Roachnamespace Fisharebest\Webtrees\Http\RequestHandlers;
21d36fce8cSGreg Roach
22d36fce8cSGreg Roachuse Fisharebest\Webtrees\View;
23d36fce8cSGreg Roachuse Psr\Http\Message\ResponseInterface;
24d36fce8cSGreg Roachuse Psr\Http\Message\ServerRequestInterface;
25d36fce8cSGreg Roachuse Psr\Http\Server\RequestHandlerInterface;
26d36fce8cSGreg Roach
27d36fce8cSGreg Roachuse function response;
28d36fce8cSGreg Roach
29d36fce8cSGreg Roach/**
30d36fce8cSGreg Roach * Respond to /apple-touch-icon.png.
31d36fce8cSGreg Roach */
32d36fce8cSGreg Roachclass BrowserconfigXml implements RequestHandlerInterface
33d36fce8cSGreg Roach{
34d36fce8cSGreg Roach    /**
35d36fce8cSGreg Roach     * @param ServerRequestInterface $request
36d36fce8cSGreg Roach     *
37d36fce8cSGreg Roach     * @return ResponseInterface
38d36fce8cSGreg Roach     */
39d36fce8cSGreg Roach    public function handle(ServerRequestInterface $request): ResponseInterface
40d36fce8cSGreg Roach    {
41d36fce8cSGreg Roach        $content = View::make('browserconfig-xml');
42d36fce8cSGreg Roach
43d36fce8cSGreg Roach        return response($content)
446172e7f6SGreg Roach            ->withHeader('content-type', 'application/xml')
456172e7f6SGreg Roach            ->withHeader('cache-control', 'public,max-age=31536000');
46d36fce8cSGreg Roach    }
47d36fce8cSGreg Roach}
48