diff --git a/spec/init_handler_spec.cr b/spec/init_handler_spec.cr index 5cc06f1..9639474 100644 --- a/spec/init_handler_spec.cr +++ b/spec/init_handler_spec.cr @@ -6,6 +6,7 @@ describe "Kemal::InitHandler" do io = MemoryIO.new response = HTTP::Server::Response.new(io) context = HTTP::Server::Context.new(request, response) + Kemal::InitHandler::INSTANCE.next = ->(context : HTTP::Server::Context) {} Kemal::InitHandler::INSTANCE.call(context) context.response.headers["Content-Type"].should eq "text/html" end diff --git a/src/kemal/init_handler.cr b/src/kemal/init_handler.cr index 0d49481..9a2c304 100644 --- a/src/kemal/init_handler.cr +++ b/src/kemal/init_handler.cr @@ -6,8 +6,8 @@ module Kemal def call(context) context.response.headers.add "X-Powered-By", "Kemal" - call_next context context.response.content_type = "text/html" unless context.response.headers.has_key?("Content-Type") + call_next context end end end