Skip to content

Commit

Permalink
add directory check
Browse files Browse the repository at this point in the history
  • Loading branch information
Tristian Kelly authored Dec 27, 2019
1 parent fc599e9 commit 762b169
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/StaticServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 762b169

Please sign in to comment.