Add next handler to init_handler_spec
This commit is contained in:
parent
d1c788f065
commit
b00bc7a202
2 changed files with 2 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue