From afdb6fb793c4bf355e0c0147cab2c44538b96798 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fatih=20Kadir=20Ak=C4=B1n?= Date: Mon, 25 Jan 2016 22:22:56 +0200 Subject: [PATCH] Fix for #67, Radix tree needs path style string --- src/kemal/handler.cr | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/kemal/handler.cr b/src/kemal/handler.cr index 7c966aa..983e946 100644 --- a/src/kemal/handler.cr +++ b/src/kemal/handler.cr @@ -27,7 +27,7 @@ class Kemal::Handler < HTTP::Handler def process_request(context) url = context.request.path.not_nil! 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? route = lookup.payload as Route if route.match?(context.request) @@ -46,8 +46,8 @@ class Kemal::Handler < HTTP::Handler return render_404(context) end - private def radix_path(method, path) - "#{method} #{path}" + private def radix_path(method : String, path) + "/#{method.downcase}#{path}" end private def add_to_radix_tree(method, path, route)