diff --git a/src/kemal/config.cr b/src/kemal/config.cr index 1510ec5..5ce26b0 100644 --- a/src/kemal/config.cr +++ b/src/kemal/config.cr @@ -49,22 +49,21 @@ module Kemal def setup_logging if @logging @logger ||= Kemal::CommonLogHandler.new(@env) - HANDLERS << @logger.not_nil! + HANDLERS.insert(0, @logger.not_nil!) else @logger = Kemal::NullLogHandler.new(@env) - HANDLERS << @logger.not_nil! end end private def setup_error_handler if @always_rescue @error_handler ||= Kemal::CommonErrorHandler::INSTANCE - HANDLERS << @error_handler.not_nil! + HANDLERS.insert(1, @error_handler.not_nil!) end end private def setup_public_folder - HANDLERS << Kemal::StaticFileHandler.new(@public_folder) if @serve_static + HANDLERS.insert(2, Kemal::StaticFileHandler.new(@public_folder)) if @serve_static end end diff --git a/src/kemal/view.cr b/src/kemal/view.cr index c1cb244..47d6cfa 100644 --- a/src/kemal/view.cr +++ b/src/kemal/view.cr @@ -67,3 +67,51 @@ def render_500(context, ex) context.response.print template context end + +# Template for 415 Unsupported media type +def render_415(context, message) + template = <<-HTML + + +
+ + + +