mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
Remove unnecessary check
This commit is contained in:
parent
17fe691710
commit
7f198cab3b
1 changed files with 3 additions and 5 deletions
|
@ -6,7 +6,6 @@ class Kemal::Handler < HTTP::Handler
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
@routes = [] of Route
|
@routes = [] of Route
|
||||||
@match = false
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def call(request)
|
def call(request)
|
||||||
|
@ -21,7 +20,7 @@ class Kemal::Handler < HTTP::Handler
|
||||||
def process_request(request)
|
def process_request(request)
|
||||||
@routes.each do |route|
|
@routes.each do |route|
|
||||||
match = route.match?(request)
|
match = route.match?(request)
|
||||||
if @match = match
|
if match
|
||||||
params = Kemal::ParamParser.new(route, request).parse
|
params = Kemal::ParamParser.new(route, request).parse
|
||||||
context = Context.new(request, params)
|
context = Context.new(request, params)
|
||||||
begin
|
begin
|
||||||
|
@ -32,9 +31,8 @@ class Kemal::Handler < HTTP::Handler
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
unless @match
|
# Render 404 unless a route matches
|
||||||
return render_404
|
return render_404
|
||||||
end
|
|
||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue