diff --git a/spec/context_spec.cr b/spec/context_spec.cr index 26d09c4..6c5f36a 100644 --- a/spec/context_spec.cr +++ b/spec/context_spec.cr @@ -44,9 +44,9 @@ describe "Context" do get "/" do |env| { - before_get: env.get("before_get"), - before_get_int: env.get("before_get_int"), - before_get_float: env.get("before_get_float") + before_get: env.get("before_get"), + before_get_int: env.get("before_get_int"), + before_get_float: env.get("before_get_float"), } end @@ -75,7 +75,7 @@ describe "Context" do get "/" do |env| { before_get_context_test: env.get("before_get_context_test"), - another_context_test: env.get("another_context_test"), + another_context_test: env.get("another_context_test"), } end @@ -91,7 +91,7 @@ describe "Context" do end it "fetches non-existent keys from store with get?" do - get "/" {} + get "/" { } request = HTTP::Request.new("GET", "/") io = IO::Memory.new diff --git a/src/kemal/param_parser.cr b/src/kemal/param_parser.cr index 1545e2b..e42a87a 100644 --- a/src/kemal/param_parser.cr +++ b/src/kemal/param_parser.cr @@ -6,7 +6,7 @@ module Kemal URL_ENCODED_FORM = "application/x-www-form-urlencoded" APPLICATION_JSON = "application/json" MULTIPART_FORM = "multipart/form-data" - PARTS = %w(url query body json) + PARTS = %w(url query body json) # :nodoc: alias AllParamTypes = Nil | String | Int64 | Float64 | Bool | Hash(String, JSON::Type) | Array(JSON::Type) getter files diff --git a/src/kemal/route_handler.cr b/src/kemal/route_handler.cr index fedfacc..686f50e 100644 --- a/src/kemal/route_handler.cr +++ b/src/kemal/route_handler.cr @@ -20,7 +20,7 @@ module Kemal # a corresponding `HEAD` route. def add_route(method : String, path : String, &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) {}) if method == "GET" + add_to_radix_tree("HEAD", path, Route.new("HEAD", path) { }) if method == "GET" end # Check if a route is defined and returns the lookup