mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
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
|
io = MemoryIO.new
|
||||||
response = HTTP::Server::Response.new(io)
|
response = HTTP::Server::Response.new(io)
|
||||||
context = HTTP::Server::Context.new(request, response)
|
context = HTTP::Server::Context.new(request, response)
|
||||||
|
Kemal::InitHandler::INSTANCE.next = ->(context : HTTP::Server::Context) {}
|
||||||
Kemal::InitHandler::INSTANCE.call(context)
|
Kemal::InitHandler::INSTANCE.call(context)
|
||||||
context.response.headers["Content-Type"].should eq "text/html"
|
context.response.headers["Content-Type"].should eq "text/html"
|
||||||
end
|
end
|
||||||
|
|
|
@ -6,8 +6,8 @@ module Kemal
|
||||||
|
|
||||||
def call(context)
|
def call(context)
|
||||||
context.response.headers.add "X-Powered-By", "Kemal"
|
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")
|
context.response.content_type = "text/html" unless context.response.headers.has_key?("Content-Type")
|
||||||
|
call_next context
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue