mirror of
				https://gitea.invidious.io/iv-org/shard-kemal.git
				synced 2024-08-15 00:53:36 +00:00 
			
		
		
		
	WIP
This commit is contained in:
		
							parent
							
								
									5f1ce1e0fc
								
							
						
					
					
						commit
						4fefd9cb5c
					
				
					 3 changed files with 11 additions and 6 deletions
				
			
		|  | @ -80,12 +80,18 @@ class Kemal::Base | |||
|   end | ||||
| 
 | ||||
|   private def start_server(port) | ||||
|     @server = server = HTTP::Server.new(@config.host_binding, port || @config.port, @handlers) | ||||
|     {% if !flag?(:without_openssl) %} | ||||
|     server.tls = config.ssl | ||||
|     @server = server = HTTP::Server.new(@handlers) | ||||
| 
 | ||||
|     {% if flag?(:without_openssl) %} | ||||
|       server.bind_tcp(@config.host_binding, port || @config.port) | ||||
|     {% else %} | ||||
|       if ssl = config.ssl | ||||
|         server.bind_tls(@config.host_binding, port || @config.port, ssl) | ||||
|       else | ||||
|         server.bind_tcp(@config.host_binding, port || @config.port) | ||||
|       end | ||||
|     {% end %} | ||||
| 
 | ||||
|     server.bind | ||||
|     @running = true | ||||
| 
 | ||||
|     yield | ||||
|  |  | |||
|  | @ -22,7 +22,7 @@ module Kemal::FileHelpers | |||
|     minsize = 860 # http://webmasters.stackexchange.com/questions/31750/what-is-recommended-minimum-object-size-for-gzip-performance-benefits ?? | ||||
|     request_headers = env.request.headers | ||||
|     filesize = File.size(file_path) | ||||
|     filestat = File.stat(file_path) | ||||
|     filestat = File.info(file_path) | ||||
| 
 | ||||
|     config.static_headers.try(&.call(env.response, file_path, filestat)) | ||||
|     gzip = config.serve_static?("gzip") | ||||
|  |  | |||
|  | @ -1,7 +1,6 @@ | |||
| require "http" | ||||
| require "json" | ||||
| require "uri" | ||||
| require "tempfile" | ||||
| require "./application" | ||||
| require "./base_log_handler" | ||||
| require "./cli" | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue