From 80b108c2de18a6d892121ce3f56762224453b38a Mon Sep 17 00:00:00 2001 From: Banana Date: Mon, 26 Jul 2021 16:50:52 +0200 Subject: [PATCH] added something to display images --- webroot/index.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/webroot/index.php b/webroot/index.php index 2f252e7..c18d715 100644 --- a/webroot/index.php +++ b/webroot/index.php @@ -79,6 +79,14 @@ if(!empty($_short)) { $_requestFile .= $_p; $_requestFile .= $_t; if(is_readable($_requestFile)) { + + $finfo = finfo_open(FILEINFO_MIME_TYPE); + $mime = finfo_file($finfo, $_requestFile); + finfo_close($finfo); + if(strstr($mime,'image/')) { + $contentType = "Content-type: $mime;"; + } + $contentBody = $_requestFile; $httpResponseCode = 200; } -- 2.39.5