Remove unnecessary handler

This commit is contained in:
Serdar Dogruyol 2015-12-16 17:06:06 +02:00
parent 06ced7790b
commit 88c19f0051
3 changed files with 0 additions and 6 deletions

View file

@ -1,7 +1,6 @@
require "./spec_helper" require "./spec_helper"
describe "Kemal::WebsocketHandler" do describe "Kemal::WebsocketHandler" do
it "doesn't match on wrong route" do it "doesn't match on wrong route" do
handler = Kemal::WebsocketHandler.new "/" { } handler = Kemal::WebsocketHandler.new "/" { }
headers = HTTP::Headers{ headers = HTTP::Headers{
@ -57,5 +56,4 @@ describe "Kemal::WebsocketHandler" do
response.headers["Sec-WebSocket-Accept"].should eq("s3pPLMBiTxaQ9kYGzzhZRbK+xOo=") response.headers["Sec-WebSocket-Accept"].should eq("s3pPLMBiTxaQ9kYGzzhZRbK+xOo=")
response.upgrade_handler.should_not be_nil response.upgrade_handler.should_not be_nil
end end
end end

View file

@ -4,7 +4,6 @@ module Kemal
class Config class Config
INSTANCE = Config.new INSTANCE = Config.new
HANDLERS = [] of HTTP::Handler HANDLERS = [] of HTTP::Handler
WS_HANDLERS = [] of HTTP::Handler
property ssl, port, env, workers, public_folder property ssl, port, env, workers, public_folder
def initialize def initialize

View file

@ -1,8 +1,5 @@
class Kemal::WebsocketHandler < HTTP::WebSocketHandler class Kemal::WebsocketHandler < HTTP::WebSocketHandler
getter handler
def initialize(@path, &@proc : WebSocketSession ->) def initialize(@path, &@proc : WebSocketSession ->)
@handler = @proc
Kemal.config.add_ws_handler self Kemal.config.add_ws_handler self
end end