Skip to content

Commit 3d2efaa

Browse files
committed
another try for the worlds worst api
1 parent bdb3a5d commit 3d2efaa

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/tasks/book2.rake

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,7 @@ def self.download(url)
144144
file = File.new("#{Rails.root}/tmp/download" + Time.now.to_i.to_s + Random.new.rand(100).to_s, 'wb')
145145
begin
146146
uri = URI.parse(url)
147-
Net::HTTP.start(uri.host,uri.port) do |http|
148-
http.use_ssl = true if uri.port == 443
147+
Net::HTTP.start(uri.host,uri.port, :use_ssl => uri.scheme == 'https') do |http|
149148
http.request_get(uri.path) do |resp|
150149
resp.read_body do |segment|
151150
file.write(segment)

0 commit comments

Comments
 (0)