From 2248475573ca3928607df7318f34af663e3c56a2 Mon Sep 17 00:00:00 2001 From: sdogruyol Date: Wed, 23 Nov 2016 20:36:56 +0300 Subject: [PATCH] Properly add status_code on exceptions. Fixes #255 --- src/kemal/common_exception_handler.cr | 1 + 1 file changed, 1 insertion(+) diff --git a/src/kemal/common_exception_handler.cr b/src/kemal/common_exception_handler.cr index 5a6756a..2b62c46 100644 --- a/src/kemal/common_exception_handler.cr +++ b/src/kemal/common_exception_handler.cr @@ -22,6 +22,7 @@ module Kemal if Kemal.config.error_handlers.has_key?(status_code) context.response.content_type = "text/html" unless context.response.headers.has_key?("Content-Type") context.response.print Kemal.config.error_handlers[status_code].call(context, exception) + context.response.status_code = status_code context end end