aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems/spec_fetcher.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rubygems/spec_fetcher.rb')
-rw-r--r--lib/rubygems/spec_fetcher.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/rubygems/spec_fetcher.rb b/lib/rubygems/spec_fetcher.rb
index aeed37ba5e..62613f7a51 100644
--- a/lib/rubygems/spec_fetcher.rb
+++ b/lib/rubygems/spec_fetcher.rb
@@ -228,10 +228,14 @@ class Gem::SpecFetcher
end
end
+ ##
+ # Attempts to upgrade +source+ to HTTPS if it is for http://rubygems.org
+
def upgrade_http_source source
uri = source.uri
- return source unless uri.scheme.downcase == 'http'
+ return source unless uri.scheme.downcase == 'http' &&
+ uri.host.downcase == 'rubygems.org'
https_uri = uri.dup
https_uri.scheme = 'https'