forked from OpenNeo/impress
Fix SWF downloading for HTTPS URLs
TNT started using HTTPS URLs! And our old Ruby version (lol 😬) still requires explicit invocation to perform SSL during a request, so requests were failing!
Now, we explicitly build the `Net::HTTPS` object, and turn on `use_ssl` if it's an HTTPS URL! (The shorthand invocation didn't seem to have an option for this, that I could find!)
This commit is contained in:
parent
8d29f50392
commit
aceffc56ab
1 changed files with 3 additions and 1 deletions
|
@ -262,7 +262,9 @@ class SwfAsset < ActiveRecord::Base
|
|||
before_create do
|
||||
uri = URI.parse url
|
||||
begin
|
||||
response = Net::HTTP.get_response(uri)
|
||||
http = Net::HTTP.new(uri.host, uri.port)
|
||||
http.use_ssl = (uri.scheme == 'https')
|
||||
response = http.get(uri.request_uri)
|
||||
rescue Exception => e
|
||||
raise DownloadError, e.message
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue