This commit is contained in:
sdogruyol 2017-05-08 17:33:19 +03:00
parent e695a491b7
commit 9f01eb90e1
4 changed files with 7 additions and 7 deletions

View file

@ -1,5 +1,5 @@
name: kemal
version: 0.18.3
version: 0.19.0
dependencies:
radix:

View file

@ -48,10 +48,10 @@ describe "Context" do
get "/" do |env|
env.set "key", "value"
{
key: env.get("key"),
before_get: env.get("before_get"),
before_get_int: env.get("before_get_int"),
before_get_float: env.get("before_get_float"),
key: env.get("key"),
before_get: env.get("before_get"),
before_get_int: env.get("before_get_int"),
before_get_float: env.get("before_get_float"),
before_get_context_test: env.get("before_get_context_test"),
}
end

View file

@ -5,7 +5,7 @@
class HTTP::Server
class Context
# :nodoc:
STORE_MAPPINGS = [ Nil, String, Int32, Int64, Float64, Bool ]
STORE_MAPPINGS = [Nil, String, Int32, Int64, Float64, Bool]
macro finished
alias StoreTypes = Union({{ *STORE_MAPPINGS }})

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) {|ctx| ""}) 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