mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
Receive Frank::Context and allow setting content-type
This commit is contained in:
parent
fc4f648c1a
commit
889debfd59
6 changed files with 41 additions and 14 deletions
|
@ -10,4 +10,14 @@ describe "Frank::Handler" do
|
|||
response = frank.call(request)
|
||||
response.body.should eq("hello")
|
||||
end
|
||||
|
||||
it "sets content type" do
|
||||
frank = Frank::Handler.new
|
||||
frank.add_route "GET", "/" do |env|
|
||||
env.response.content_type = "application/json"
|
||||
end
|
||||
request = HTTP::Request.new("GET", "/")
|
||||
response = frank.call(request)
|
||||
response.headers["Content-Type"].should eq("application/json")
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue