Skip to content

Commit 417cd00

Browse files
committed
Supports proxy authentication
1 parent 02ab846 commit 417cd00

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
@@ -402,7 +402,11 @@ def http_connection(uri)
402402
env = ENV['http_proxy'] || ENV['HTTP_PROXY']
403403
connection = if env
404404
proxy = URI(env)
405-
Net::HTTP::Proxy(proxy.host, proxy.port).new(uri.host, uri.port)
405+
if proxy.user
406+
Net::HTTP::Proxy(proxy.host, proxy.port, proxy.user, proxy.password).new(uri.host, uri.port)
407+
else
408+
Net::HTTP::Proxy(proxy.host, proxy.port).new(uri.host, uri.port)
409+
end
406410
else
407411
Net::HTTP.new(uri.host, uri.port)
408412
end

0 commit comments

Comments
 (0)