summaryrefslogtreecommitdiff
path: root/app/Http/RequestHandlers/AppleTouchIconPng.php
diff options
context:
space:
mode:
authorGreg Roach <greg@subaqua.co.uk>2020-04-17 17:56:32 +0100
committerGreg Roach <greg@subaqua.co.uk>2020-04-17 17:56:32 +0100
commit46431a62d3382289134aa90d447974f9707a1414 (patch)
tree6da862e7d5a05d979a664ede66fb862eb090388f /app/Http/RequestHandlers/AppleTouchIconPng.php
parenta06d38dce3d90a71d19a21f477b5a4d4e51a0e8e (diff)
downloadwebtrees-46431a62d3382289134aa90d447974f9707a1414.tar.gz
webtrees-46431a62d3382289134aa90d447974f9707a1414.tar.bz2
webtrees-46431a62d3382289134aa90d447974f9707a1414.zip
Add routes for static files in root folder
Diffstat (limited to 'app/Http/RequestHandlers/AppleTouchIconPng.php')
-rw-r--r--app/Http/RequestHandlers/AppleTouchIconPng.php54
1 files changed, 54 insertions, 0 deletions
diff --git a/app/Http/RequestHandlers/AppleTouchIconPng.php b/app/Http/RequestHandlers/AppleTouchIconPng.php
new file mode 100644
index 0000000000..2aa2013c79
--- /dev/null
+++ b/app/Http/RequestHandlers/AppleTouchIconPng.php
@@ -0,0 +1,54 @@
+<?php
+
+/**
+ * webtrees: online genealogy
+ * Copyright (C) 2019 webtrees development team
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+declare(strict_types=1);
+
+namespace Fisharebest\Webtrees\Http\RequestHandlers;
+
+use Fisharebest\Webtrees\Auth;
+use Fisharebest\Webtrees\FlashMessages;
+use Fisharebest\Webtrees\I18N;
+use Fisharebest\Webtrees\Log;
+use Fisharebest\Webtrees\User;
+use Psr\Http\Message\ResponseInterface;
+use Psr\Http\Message\ServerRequestInterface;
+use Psr\Http\Server\RequestHandlerInterface;
+
+use function file_get_contents;
+use function redirect;
+use function response;
+use function route;
+
+/**
+ * Respond to /apple-touch-icon.png.
+ */
+class AppleTouchIconPng implements RequestHandlerInterface
+{
+ /**
+ * @param ServerRequestInterface $request
+ *
+ * @return ResponseInterface
+ */
+ public function handle(ServerRequestInterface $request): ResponseInterface
+ {
+ $content = file_get_contents(__DIR__ . '/../../../apple-touch-icon.png');
+
+ return response($content)
+ ->withHeader('Content-Type', 'image/png')
+ ->withHeader('Cache-Control', 'max-age=2592000');
+ }
+}