lib/onebox/helpers.rb in onebox-2.2.15 vs lib/onebox/helpers.rb in onebox-2.2.16

- old
+ new

@@ -61,12 +61,11 @@ return response_body end end result = StringIO.new - Net::HTTP.start(uri.host, uri.port, use_ssl: uri.normalized_scheme == 'https') do |http| - http.open_timeout = Onebox.options.connect_timeout + Net::HTTP.start(uri.host, uri.port, open_timeout: Onebox.options.connect_timeout, use_ssl: uri.normalized_scheme == 'https') do |http| http.read_timeout = Onebox.options.timeout http.verify_mode = OpenSSL::SSL::VERIFY_NONE # Work around path building bugs headers ||= {} @@ -116,11 +115,10 @@ end def self.fetch_content_length(location) uri = URI(location) - Net::HTTP.start(uri.host, uri.port, use_ssl: uri.is_a?(URI::HTTPS)) do |http| - http.open_timeout = Onebox.options.connect_timeout + Net::HTTP.start(uri.host, uri.port, open_timeout: Onebox.options.connect_timeout, use_ssl: uri.is_a?(URI::HTTPS)) do |http| http.read_timeout = Onebox.options.timeout if uri.is_a?(URI::HTTPS) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE end