mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
decoupled-urlparams-from-routehandler
This commit is contained in:
parent
43d34886c4
commit
8f6b00ba55
3 changed files with 2 additions and 2 deletions
|
@ -3,6 +3,7 @@
|
|||
class HTTP::Server
|
||||
class Context
|
||||
def params
|
||||
@request.url_params = route_lookup.params
|
||||
@params ||= Kemal::ParamParser.new(@request).parse
|
||||
end
|
||||
|
||||
|
|
|
@ -18,10 +18,10 @@ class Kemal::ParamParser
|
|||
end
|
||||
|
||||
def parse_request
|
||||
parse_url_params
|
||||
parse_query
|
||||
parse_body
|
||||
parse_json
|
||||
parse_url_params
|
||||
@params
|
||||
end
|
||||
|
||||
|
|
|
@ -33,7 +33,6 @@ class Kemal::RouteHandler < HTTP::Handler
|
|||
def process_request(context)
|
||||
raise Kemal::Exceptions::RouteNotFound.new(context) unless context.route_defined?
|
||||
route = context.route_lookup.payload as Route
|
||||
context.request.url_params = context.route_lookup.params
|
||||
context.response.print(route.handler.call(context).to_s)
|
||||
context
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue