Fix WebSocketHandler

This commit is contained in:
sdogruyol 2016-03-23 13:21:19 +02:00
parent 21d37f564d
commit be418feaf3
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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