mirror of
https://github.com/github/codeql.git
synced 2026-05-05 05:35:13 +02:00
Ruby: Fix rack response tracking
Use type tracking instead of getReturningNode, which seems to be faster and works correctly for the cases I've tried.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
| rack.rb:1:1:5:3 | HelloWorld | rack.rb:2:12:2:14 | env |
|
||||
| rack.rb:7:1:16:3 | Proxy | rack.rb:12:12:12:18 | the_env |
|
||||
| rack.rb:18:1:31:3 | Logger | rack.rb:24:12:24:14 | env |
|
||||
| rack.rb:45:1:61:3 | Baz | rack.rb:46:12:46:14 | env |
|
||||
|
||||
@@ -41,3 +41,21 @@ class Bar
|
||||
nil
|
||||
end
|
||||
end
|
||||
|
||||
class Baz
|
||||
def call(env)
|
||||
run(env)
|
||||
end
|
||||
|
||||
def run(env)
|
||||
if env[:foo] == "foo"
|
||||
[200, {}, "foo"]
|
||||
else
|
||||
error
|
||||
end
|
||||
end
|
||||
|
||||
def error
|
||||
[400, {}, "nope"]
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user