summaryrefslogtreecommitdiffstats
path: root/Rakefile
diff options
context:
space:
mode:
authorTails developers <amnesia@boum.org>2012-05-13 21:54:35 +0200
committerTails developers <amnesia@boum.org>2012-05-16 12:53:18 +0200
commitc2f42105022e1331999c1d926285730cefafab9a (patch)
treea7009b65fbf13cb0c7378f0ac12425d53614c82b /Rakefile
parent20d07c796492b4d7e4b7a7d5237e1e9d0d414bda (diff)
vagrant: Handle invalid http_proxy gracefully
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile6
1 files changed, 6 insertions, 0 deletions
diff --git a/Rakefile b/Rakefile
index 031a278..5b92c4c 100644
--- a/Rakefile
+++ b/Rakefile
@@ -31,6 +31,12 @@ task :validate_http_proxy do
if ENV['http_proxy']
proxy_host = URI.parse(ENV['http_proxy']).host
+ if proxy_host.nil?
+ ENV['http_proxy'] = nil
+ $stderr.puts "Ignoring invalid HTTP proxy."
+ return
+ end
+
if ['localhost', '[::1]'].include?(proxy_host) || proxy_host.start_with?('127.0.0.')
abort 'Using an HTTP proxy listening on the loopback is doomed to fail. Aborting.'
end