diff --git a/src/Symfony/Component/HttpKernel/Debug/ExceptionHandler.php b/src/Symfony/Component/HttpKernel/Debug/ExceptionHandler.php index 9dcefc7a12..848f3ccf5b 100644 --- a/src/Symfony/Component/HttpKernel/Debug/ExceptionHandler.php +++ b/src/Symfony/Component/HttpKernel/Debug/ExceptionHandler.php @@ -100,7 +100,7 @@ class ExceptionHandler } } - return new Response($this->decorate($content, $title), $exception->getStatusCode()); + return new Response($this->decorate($content, $title), $exception->getStatusCode(), $exception->getHeaders()); } private function getContent($exception) diff --git a/src/Symfony/Component/HttpKernel/Tests/Debug/ExceptionHandlerTest.php b/src/Symfony/Component/HttpKernel/Tests/Debug/ExceptionHandlerTest.php index 8c61f5a57d..c13e559362 100644 --- a/src/Symfony/Component/HttpKernel/Tests/Debug/ExceptionHandlerTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/Debug/ExceptionHandlerTest.php @@ -13,6 +13,7 @@ namespace Symfony\Component\HttpKernel\Tests\Debug; use Symfony\Component\HttpKernel\Debug\ExceptionHandler; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; +use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException; class ExceptionHandlerTest extends \PHPUnit_Framework_TestCase { @@ -51,6 +52,15 @@ class ExceptionHandlerTest extends \PHPUnit_Framework_TestCase $this->assertContains('