mirror of
				https://gitea.invidious.io/iv-org/shard-kemal.git
				synced 2024-08-15 00:53:36 +00:00 
			
		
		
		
	Remove redundant intermediate var from process_route
This commit is contained in:
		
							parent
							
								
									b8e3298925
								
							
						
					
					
						commit
						422313425c
					
				
					 2 changed files with 5 additions and 2 deletions
				
			
		|  | @ -32,6 +32,10 @@ class HTTP::Server | |||
|       @response.status_code = status_code | ||||
|     end | ||||
| 
 | ||||
|     def route | ||||
|       route_lookup.payload.as(Route) | ||||
|     end | ||||
| 
 | ||||
|     def route_lookup | ||||
|       Kemal::RouteHandler::INSTANCE.lookup_route(@request.override_method.as(String), @request.path) | ||||
|     end | ||||
|  |  | |||
|  | @ -42,8 +42,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_defined? | ||||
|       route = context.route_lookup.payload.as(Route) | ||||
|       content = route.handler.call(context) | ||||
|       content = context.route.handler.call(context) | ||||
|     ensure | ||||
|       if Kemal.config.error_handlers.has_key?(context.response.status_code) | ||||
|         raise Kemal::Exceptions::CustomException.new(context) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue