Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for #67, Radix tree needs path style string #68

Merged
merged 1 commit into from
Jan 25, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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