mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
Introduce Kemal::InitHandler to initialize HTTP::Server::Context with defaults
This commit is contained in:
parent
725e051723
commit
09d9e708f1
10 changed files with 48 additions and 40 deletions
|
@ -1,15 +1,6 @@
|
|||
require "./spec_helper"
|
||||
|
||||
describe "Context" do
|
||||
it "has a default content type" do
|
||||
get "/" do |env|
|
||||
"Hello"
|
||||
end
|
||||
request = HTTP::Request.new("GET", "/")
|
||||
client_response = call_request_on_app(request)
|
||||
client_response.headers["Content-Type"].should eq("text/html")
|
||||
end
|
||||
|
||||
it "sets content type" do
|
||||
get "/" do |env|
|
||||
env.response.content_type = "application/json"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue