diff --git a/src/StaticServer.php b/src/StaticServer.php index bbb9c25..4514f23 100644 --- a/src/StaticServer.php +++ b/src/StaticServer.php @@ -13,7 +13,7 @@ public static function serve(string $path) $filePath = $request->getUri()->getPath(); $file = $path.$filePath; - if (file_exists($file)) { + if (file_exists($file) && !is_dir($file)) { $fileExt = pathinfo($file, PATHINFO_EXTENSION); $finfo = finfo_open(FILEINFO_MIME_TYPE); $fileType = finfo_file($finfo, $file);