Format code
This commit is contained in:
parent
4c9b9ad3d5
commit
5a58ee3cbb
5 changed files with 1 additions and 6 deletions
|
@ -143,7 +143,6 @@ describe "Kemal::Middleware::Filters" do
|
||||||
client_response = HTTP::Client::Response.from_io(io_with_context, decompress: false)
|
client_response = HTTP::Client::Response.from_io(io_with_context, decompress: false)
|
||||||
client_response.body.should eq("false")
|
client_response.body.should eq("false")
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
class FilterTest
|
class FilterTest
|
||||||
|
|
|
@ -18,6 +18,5 @@ class HTTP::Server
|
||||||
def route_defined?
|
def route_defined?
|
||||||
route_lookup.found?
|
route_lookup.found?
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -85,7 +85,7 @@ end
|
||||||
# - after_all, after_get, after_post, after_put, after_patch, after_delete
|
# - after_all, after_get, after_post, after_put, after_patch, after_delete
|
||||||
|
|
||||||
ALL_METHODS = %w(get post put patch delete all)
|
ALL_METHODS = %w(get post put patch delete all)
|
||||||
{% for type in ["before", "after"]%}
|
{% for type in ["before", "after"] %}
|
||||||
{% for method in ALL_METHODS %}
|
{% for method in ALL_METHODS %}
|
||||||
def {{type.id}}_{{method.id}}(path = "*", &block : HTTP::Server::Context -> _)
|
def {{type.id}}_{{method.id}}(path = "*", &block : HTTP::Server::Context -> _)
|
||||||
Kemal::Middleware::Filter::INSTANCE.{{type.id}}({{method}}.upcase, path, &block)
|
Kemal::Middleware::Filter::INSTANCE.{{type.id}}({{method}}.upcase, path, &block)
|
||||||
|
|
|
@ -25,5 +25,4 @@ class HTTP::Request
|
||||||
override_method = override_method.upcase
|
override_method = override_method.upcase
|
||||||
override_method == "PUT" || override_method == "PATCH" || override_method == "DELETE"
|
override_method == "PUT" || override_method == "PATCH" || override_method == "DELETE"
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -7,6 +7,4 @@ class Kemal::Route
|
||||||
|
|
||||||
def initialize(@method, @path, &@handler : HTTP::Server::Context -> _)
|
def initialize(@method, @path, &@handler : HTTP::Server::Context -> _)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue