Introduce Kemal::InitHandler to initialize HTTP::Server::Context with defaults

This commit is contained in:
Sdogruyol 2016-07-17 18:11:26 +03:00
parent 725e051723
commit 09d9e708f1
10 changed files with 48 additions and 40 deletions

View file

@ -155,20 +155,4 @@ describe "Kemal::RouteHandler" do
client_response.status_code.should eq(302)
client_response.headers.has_key?("Location").should eq(true)
end
it "sets default Content-Type to context html" do
get "/" do |env|
"Hello World from GET"
end
request = HTTP::Request.new("GET", "/")
client_response = call_request_on_app(request)
client_response.content_type.should eq("text/html")
end
it "sets X-Powered-By to Kemal" do
get "/" { }
request = HTTP::Request.new("GET", "/")
client_response = call_request_on_app(request)
client_response.headers["X-Powered-By"].should eq("Kemal")
end
end