diff options
Diffstat (limited to 'lib/bundler')
-rw-r--r-- | lib/bundler/mirror.rb | 3 | ||||
-rw-r--r-- | lib/bundler/settings.rb | 6 |
2 files changed, 3 insertions, 6 deletions
diff --git a/lib/bundler/mirror.rb b/lib/bundler/mirror.rb index 655d2b3d07..7d872966ee 100644 --- a/lib/bundler/mirror.rb +++ b/lib/bundler/mirror.rb @@ -43,7 +43,8 @@ module Bundler private def fetch_valid_mirror_for(uri) - mirror = (@mirrors[URI(uri.to_s.downcase)] || Mirror.new(uri)).validate!(@prober) + host = Settings.normalize_uri(URI(uri.to_s).host) + mirror = (@mirrors[URI(uri.to_s.downcase)] || @mirrors[host] || Mirror.new(uri)).validate!(@prober) mirror = Mirror.new(uri) unless mirror.valid? mirror end diff --git a/lib/bundler/settings.rb b/lib/bundler/settings.rb index 0c846d195c..f69b035d65 100644 --- a/lib/bundler/settings.rb +++ b/lib/bundler/settings.rb @@ -289,11 +289,7 @@ module Bundler def self.normalize_uri(uri) uri = uri.to_s uri = "#{uri}/" unless uri =~ %r{/\Z} - uri = URI(uri) - unless uri.absolute? - raise ArgumentError, "Gem sources must be absolute. You provided '#{uri}'." - end - uri + URI(uri) end end end |