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:
Harry Maclean
2023-08-23 12:55:36 +01:00
parent fb4b774c0d
commit d18ca3f5d7
2 changed files with 21 additions and 4 deletions

View File

@@ -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