diff --git a/repo.php b/repo.php index 1e4e5111..c58ab485 100644 --- a/repo.php +++ b/repo.php @@ -62,8 +62,20 @@ if ($branchId) { if (array_key_exists('file', $_REQUEST)) { $file = $repo->file_get_contents($_REQUEST['file']); - Header("Content-Type: text/plain; charset=utf/8"); - print $file; + + if ($file === false) { + Header("HTTP/1.1 403 Forbidden"); + print "Access denied."; + } + else if ($file === null) { + Header("HTTP/1.1 404 File not found"); + print "File not found."; + } + else { + Header("Content-Type: text/plain; charset=utf-8"); + print $file; + } + exit(0); }