return no body for head route fixes #323 (#325)

This commit is contained in:
Cris Ward 2017-03-10 11:13:38 +00:00 committed by Serdar Dogruyol
parent f8eb863ea8
commit 1c527c2d94

View file

@ -21,7 +21,7 @@ module Kemal
# a corresponding `HEAD` route.
def add_route(method, path, &handler : HTTP::Server::Context -> _)
add_to_radix_tree method, path, Route.new(method, path, &handler)
add_to_radix_tree("HEAD", path, Route.new("HEAD", path, &handler)) if method == "GET"
add_to_radix_tree("HEAD", path, Route.new("HEAD", path) {|ctx| ""}) if method == "GET"
end
# Check if a route is defined and returns the lookup