File tree Expand file tree Collapse file tree
src/analyzer/analyzers/perl Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ require "../../engines/perl_engine"
22
33module Analyzer::Perl
44 class Mojolicious < PerlEngine
5- HTTP_VERBS = %w( get post put delete patch options head)
5+ HTTP_VERBS = %w[ get post put delete patch options head]
66 LITE_VERB_RE = /^\s *(get|post|put|patch|delete|del|options|head|websocket) \s +['"] ([^'"] +) ['"] /
77 LITE_ANY_RE = /^\s *any\s +(?:\[ ([^\] ] +) \]\s *=>\s *) ?['"] ([^'"] +) ['"] /
88 FULL_VERB_RE = /->\s *(get|post|put|patch|delete|del|options|head|websocket) \s *\(\s *['"] ([^'"] +) ['"] /
@@ -38,7 +38,16 @@ module Analyzer::Perl
3838 endpoints << endpoint
3939 end
4040
41- targets = line_endpoints.empty? ? (last_endpoint ? [last_endpoint.not_nil!] : [] of Endpoint ) : line_endpoints
41+ targets = if line_endpoints.empty?
42+ if le = last_endpoint
43+ [le]
44+ else
45+ [] of Endpoint
46+ end
47+ else
48+ line_endpoints
49+ end
50+
4251 targets.each do |target |
4352 extract_params_from_line(line, target.method).each do |param |
4453 push_unique_param(target, param)
You can’t perform that action at this time.
0 commit comments