fix process request when a response already closed (#550)

This commit is contained in:
Anton Maminov 2019-08-05 18:34:26 +03:00 committed by Serdar Dogruyol
parent ff3b28c6f7
commit e99129ab50
2 changed files with 19 additions and 0 deletions

View file

@ -45,6 +45,7 @@ module Kemal
# Processes the route if it's a match. Otherwise renders 404.
private def process_request(context)
raise Kemal::Exceptions::RouteNotFound.new(context) unless context.route_found?
return if context.response.closed?
content = context.route.handler.call(context)
if !Kemal.config.error_handlers.empty? && Kemal.config.error_handlers.has_key?(context.response.status_code)