mirror of
https://github.com/github/codeql.git
synced 2026-05-05 13:45:19 +02:00
Ruby: Fix bug in excon model
If a codebase included a definition for `Excon.new`, we matched connection nodes to unrelated request nodes.
This commit is contained in:
@@ -46,4 +46,23 @@ def method8
|
||||
# GOOD
|
||||
Excon.defaults[:ssl_verify_peer] = false
|
||||
Excon.new("http://example.com/", ssl_verify_peer: true)
|
||||
end
|
||||
|
||||
# Regression test for excon
|
||||
|
||||
class Excon
|
||||
def self.new(params)
|
||||
Excon::Connection.new(params)
|
||||
end
|
||||
end
|
||||
|
||||
def method9
|
||||
# GOOD: connection is not used
|
||||
Excon.new("foo", ssl_verify_peer: false)
|
||||
end
|
||||
|
||||
def method10
|
||||
# GOOD
|
||||
connection = Excon.new("foo")
|
||||
connection.get("bar")
|
||||
end
|
||||
Reference in New Issue
Block a user