commit f5d99b563ccdf7463698693fe50cc10767e4e76b parent 7d6019b0fa0676580a03ca693f6b42f4794532ca Author: Claudio Alessi <smoppy@gmail.com> Date: Fri, 21 Jun 2019 16:02:43 +0200 Use http_response_code() to returns 404. Diffstat:
M | bored.php | | | 7 | ++----- |
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/bored.php b/bored.php @@ -69,11 +69,8 @@ function route($method, $route, $func = null) { $argv = []; } } - if(!$r || (count($argv) < $r['mandatory']) || (count($argv) > $r['argc'])) { - header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found'); - header("Status: 404 Not Found"); /* CGI */ - exit(1); - } + if(!$r || (count($argv) < $r['mandatory']) || (count($argv) > $r['argc'])) + exit(http_response_code(404)); return call_user_func_array($r['func'], $argv); } $name = [];