mirror of
				https://gitea.invidious.io/iv-org/shard-kemal.git
				synced 2024-08-15 00:53:36 +00:00 
			
		
		
		
	Remove unnecessary handler
This commit is contained in:
		
							parent
							
								
									06ced7790b
								
							
						
					
					
						commit
						88c19f0051
					
				
					 3 changed files with 0 additions and 6 deletions
				
			
		|  | @ -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 | ||||||
|  |  | ||||||
|  | @ -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 | ||||||
|  |  | ||||||
|  | @ -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 | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue