From 6a2c861a711de73fbc12768a83c08175897dc085 Mon Sep 17 00:00:00 2001 From: Alexander Demidov Date: Tue, 13 Nov 2012 14:03:42 +0400 Subject: [PATCH] Switch http code header on showDebug with ErrorHTTPException. --- app/FrontController.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/FrontController.php b/app/FrontController.php index bd5f13d..43bbec9 100644 --- a/app/FrontController.php +++ b/app/FrontController.php @@ -131,7 +131,11 @@ class FrontController } catch (Exception $e) { if (Config::get('DEBUG')) { if (!headers_sent()) { - header('HTTP/1.0 500 Internal Server Error'); + if ($e instanceof ErrorHTTPException) { + header($e->getHTTPHeader()); + } else { + header('HTTP/1.0 500 Internal Server Error'); + } } return ErrorHandler::showDebug($e); }