Skip to content

Commit

Permalink
Merge pull request #68 from f/master
Browse files Browse the repository at this point in the history
Fix for #67, Radix tree needs path style string
  • Loading branch information
Serdar Dogruyol committed Jan 25, 2016
2 parents 3b4cdd5 + afdb6fb commit 23b09ff
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/kemal/handler.cr
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 23b09ff

Please sign in to comment.