Skip to content

Commit 17f0f3d

Browse files
authored
Merge pull request #306 from hide5stm/support_proxy_auth
Supports proxy authentication
2 parents 9561690 + 417cd00 commit 17f0f3d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/gist.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,11 @@ def http_connection(uri)
454454
env = ENV['http_proxy'] || ENV['HTTP_PROXY']
455455
connection = if env
456456
proxy = URI(env)
457-
Net::HTTP::Proxy(proxy.host, proxy.port).new(uri.host, uri.port)
457+
if proxy.user
458+
Net::HTTP::Proxy(proxy.host, proxy.port, proxy.user, proxy.password).new(uri.host, uri.port)
459+
else
460+
Net::HTTP::Proxy(proxy.host, proxy.port).new(uri.host, uri.port)
461+
end
458462
else
459463
Net::HTTP.new(uri.host, uri.port)
460464
end

0 commit comments

Comments
 (0)