Update CHANGELOG for GH-502

This commit is contained in:
Mitchell Hashimoto 2011-11-24 21:58:40 -07:00
parent 4c01a87ab3
commit 331b5c20a8
2 changed files with 18 additions and 10 deletions

View File

@ -12,6 +12,8 @@
available. [GH-556]
- NFS should work for FreeBSD hosts now. [GH-510]
- SSH executed methods respect `config.ssh.max_tries`. [GH-508]
- `vagrant box add` now respects the "no_proxy" environmental variable.
[GH-502]
## 0.8.7 (September 13, 2011)

View File

@ -16,10 +16,9 @@ module Vagrant
end
def download!(source_url, destination_file)
uri = URI.parse(source_url)
proxy_uri = resolve_proxy(uri)
http = Net::HTTP.new(uri.host, uri.port, proxy_uri.host, proxy_uri.port, proxy_uri.user, proxy_uri.password)
if uri.scheme == "https"
@ -76,16 +75,23 @@ module Vagrant
private
# This method respects the "http_proxy" and "no_proxy" environmental
# variables so that HTTP proxies can properly be used with Vagrant.
def resolve_proxy(source_uri)
proxy_string = nil
if ENV['no_proxy'] && ENV['no_proxy'].split(',').any? { |h| source_uri.host =~ /#{Regexp.quote(h.strip)}$/ }
proxy_string = ''
else
proxy_string = ENV["http_proxy"] || ''
end
URI.parse(proxy_string)
end
proxy_string = ENV["http_proxy"] || ""
if !proxy_string.empty? && ENV.has_key?("no_proxy")
# Respect the "no_proxy" environmental variable which contains a list
# of hosts that a proxy should not be used for.
ENV["no_proxy"].split(",").each do |host|
if source_uri.host =~ /#{Regexp.quote(host.strip)}$/
proxy_string = ""
break
end
end
end
URI.parse(proxy_string)
end
end
end
end