From b00bc7a202ce4b715538ad030dbb843c1c893368 Mon Sep 17 00:00:00 2001 From: Sdogruyol Date: Sun, 17 Jul 2016 20:42:00 +0300 Subject: [PATCH] Add next handler to init_handler_spec --- spec/init_handler_spec.cr | 1 + src/kemal/init_handler.cr | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) 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