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 name: kemal
version: 0.18.3 version: 0.19.0
dependencies: dependencies:
radix: radix:

View file

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

View file

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

View file

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