mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
Accepts requests with query string
This commit is contained in:
parent
7e841a88b2
commit
8b1447b68d
3 changed files with 23 additions and 1 deletions
|
@ -11,6 +11,16 @@ describe "Frank::Handler" do
|
|||
response.body.should eq("hello")
|
||||
end
|
||||
|
||||
it "routes request with query string" do
|
||||
frank = Frank::Handler.new
|
||||
frank.add_route "GET", "/" do |ctx|
|
||||
"hello #{ctx.params["message"]}"
|
||||
end
|
||||
request = HTTP::Request.new("GET", "/?message=world")
|
||||
response = frank.call(request)
|
||||
response.body.should eq("hello world")
|
||||
end
|
||||
|
||||
it "sets content type" do
|
||||
frank = Frank::Handler.new
|
||||
frank.add_route "GET", "/" do |env|
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue