Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Skip proxy look up from environment
Fix #116. Adds configuration option to skip proxy look up from environment. Works with Ruby 1.9.3 as well as 2.0.0.
  • Loading branch information
Sriharshavardhan T committed Dec 3, 2013
commit 475dbd14c9f9b33ad570e439ed7bcd89b54fa695
1 change: 1 addition & 0 deletions config.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ http_settings:
# ca_file: /etc/ssl/cert.pem
# ca_path: /etc/pki/tls/certs
self_signed_cert: false
proxy_from_env: false

# Repositories path
# Give the canonicalized absolute pathname,
Expand Down
6 changes: 5 additions & 1 deletion lib/gitlab_net.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ def get(url)
$logger.debug "Performing GET #{url}"

url = URI.parse(url)
http = Net::HTTP.new(url.host, url.port)
if config.http_settings['proxy_from_env']
http = Net::HTTP.new(url.host, url.port)
else
http = Net::HTTP.new(url.host, url.port, nil)
end

if URI::HTTPS === url
http.use_ssl = true
Expand Down