mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
Dynamically insert handlers. Fixes #376
This commit is contained in:
parent
dbbe05a610
commit
1d056b203b
7 changed files with 73 additions and 20 deletions
|
@ -112,9 +112,6 @@ describe "Handler" do
|
|||
"Post"
|
||||
end
|
||||
add_handler PostOnlyHandler.new
|
||||
request = HTTP::Request.new("POST", "/only")
|
||||
client_response = call_request_on_app(request)
|
||||
client_response.body.should eq "OnlyPost"
|
||||
add_handler PostExcludeHandler.new
|
||||
request = HTTP::Request.new("POST", "/only")
|
||||
client_response = call_request_on_app(request)
|
||||
|
@ -124,6 +121,7 @@ describe "Handler" do
|
|||
it "adds a handler at given position" do
|
||||
post_handler = PostOnlyHandler.new
|
||||
add_handler post_handler, 1
|
||||
Kemal.config.setup
|
||||
Kemal.config.handlers[1].should eq post_handler
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue