We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bdb3a5d commit 3d2efaaCopy full SHA for 3d2efaa
lib/tasks/book2.rake
@@ -144,8 +144,7 @@ def self.download(url)
144
file = File.new("#{Rails.root}/tmp/download" + Time.now.to_i.to_s + Random.new.rand(100).to_s, 'wb')
145
begin
146
uri = URI.parse(url)
147
- Net::HTTP.start(uri.host,uri.port) do |http|
148
- http.use_ssl = true if uri.port == 443
+ Net::HTTP.start(uri.host,uri.port, :use_ssl => uri.scheme == 'https') do |http|
149
http.request_get(uri.path) do |resp|
150
resp.read_body do |segment|
151
file.write(segment)
0 commit comments