Use replace instead of each for replacing handlers
This commit is contained in:
parent
62946fd987
commit
ce024ba748
1 changed files with 1 additions and 1 deletions
|
@ -62,7 +62,7 @@ module Kemal
|
||||||
|
|
||||||
def handlers=(handlers : Array(HTTP::Handler))
|
def handlers=(handlers : Array(HTTP::Handler))
|
||||||
clear
|
clear
|
||||||
handlers.each { |handler| HANDLERS << handler }
|
HANDLERS.replace(handlers)
|
||||||
end
|
end
|
||||||
|
|
||||||
def add_handler(handler : HTTP::Handler | HTTP::WebSocketHandler, position = Kemal.config.custom_handler_position)
|
def add_handler(handler : HTTP::Handler | HTTP::WebSocketHandler, position = Kemal.config.custom_handler_position)
|
||||||
|
|
Loading…
Reference in a new issue