mirror of
				https://gitea.invidious.io/iv-org/shard-kemal.git
				synced 2024-08-15 00:53:36 +00:00 
			
		
		
		
	Do not try to call ExceptionHandler#call_exception_with_status_code on a closed response. Fixes #514
This commit is contained in:
		
							parent
							
								
									0fa869cf96
								
							
						
					
					
						commit
						b0a17ac9b4
					
				
					 2 changed files with 11 additions and 0 deletions
				
			
		|  | @ -18,6 +18,7 @@ module Kemal | |||
|     end | ||||
| 
 | ||||
|     private def call_exception_with_status_code(context : HTTP::Server::Context, exception : Exception, status_code : Int32) | ||||
|       return if context.response.closed? | ||||
|       if !Kemal.config.error_handlers.empty? && Kemal.config.error_handlers.has_key?(status_code) | ||||
|         context.response.content_type = "text/html" unless context.response.headers.has_key?("Content-Type") | ||||
|         context.response.status_code = status_code | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue