File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -651,13 +651,23 @@ def connection_for uri
651651
652652 return yield connection
653653 rescue Errno ::ECONNREFUSED
654- address = http . proxy_address || http . address
655- port = http . proxy_port || http . port
654+ if http . proxy?
655+ address = http . proxy_address
656+ port = http . proxy_port
657+ else
658+ address = http . address
659+ port = http . port
660+ end
656661
657662 raise Error , "connection refused: #{ address } :#{ port } "
658663 rescue Errno ::EHOSTDOWN
659- address = http . proxy_address || http . address
660- port = http . proxy_port || http . port
664+ if http . proxy?
665+ address = http . proxy_address
666+ port = http . proxy_port
667+ else
668+ address = http . address
669+ port = http . port
670+ end
661671
662672 raise Error , "host down: #{ address } :#{ port } "
663673 ensure
You can’t perform that action at this time.
0 commit comments