mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
Merge pull request #68 from f/master
Fix for #67, Radix tree needs path style string
This commit is contained in:
commit
23b09ff645
1 changed files with 3 additions and 3 deletions
|
@ -27,7 +27,7 @@ class Kemal::Handler < HTTP::Handler
|
||||||
def process_request(context)
|
def process_request(context)
|
||||||
url = context.request.path.not_nil!
|
url = context.request.path.not_nil!
|
||||||
Kemal::Route.check_for_method_override!(context.request)
|
Kemal::Route.check_for_method_override!(context.request)
|
||||||
lookup = @tree.find radix_path(context.request.override_method, context.request.path)
|
lookup = @tree.find radix_path(context.request.override_method as String, context.request.path)
|
||||||
if lookup.found?
|
if lookup.found?
|
||||||
route = lookup.payload as Route
|
route = lookup.payload as Route
|
||||||
if route.match?(context.request)
|
if route.match?(context.request)
|
||||||
|
@ -46,8 +46,8 @@ class Kemal::Handler < HTTP::Handler
|
||||||
return render_404(context)
|
return render_404(context)
|
||||||
end
|
end
|
||||||
|
|
||||||
private def radix_path(method, path)
|
private def radix_path(method : String, path)
|
||||||
"#{method} #{path}"
|
"/#{method.downcase}#{path}"
|
||||||
end
|
end
|
||||||
|
|
||||||
private def add_to_radix_tree(method, path, route)
|
private def add_to_radix_tree(method, path, route)
|
||||||
|
|
Loading…
Reference in a new issue