Fix WebSocketHandler
This commit is contained in:
parent
21d37f564d
commit
be418feaf3
|
@ -6,6 +6,6 @@ HTTP_METHODS = %w(get post put patch delete options)
|
|||
end
|
||||
{% end %}
|
||||
|
||||
def ws(path, &block : HTTP::WebSocket -> _)
|
||||
def ws(path, &block : HTTP::WebSocket, HTTP::Context -> Void)
|
||||
Kemal::WebSocketHandler.new path, &block
|
||||
end
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Kemal::WebSocketHandler is used for each define WebSocket route.
|
||||
# For each WebSocket route a new handler is created and registered to global handlers.
|
||||
class Kemal::WebSocketHandler < HTTP::WebSocketHandler
|
||||
def initialize(@path, &@proc : HTTP::WebSocket ->)
|
||||
def initialize(@path, &@proc : HTTP::WebSocket, HTTP::Server::Context -> Void)
|
||||
Kemal.config.add_ws_handler self
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue