This commit is contained in:
2021-04-03 13:05:20 +02:00
parent d1f030542a
commit c81e9e8776
2 changed files with 6 additions and 2 deletions

View File

@@ -139,8 +139,8 @@ function serveStatic(string $webRoot, string $file): string {
$pathInfo = pathinfo($path);
// TODO: add more file extensions here
$allowedExtension = array("html", "htm");
// TODO: add more file extensions here, probably add them to settings?
$allowedExtension = array("html", "htm", "pdf");
$ext = $pathInfo["extension"] ?? "";
if (!in_array($ext, $allowedExtension)) {
http_response_code(406);