Skip to content

Commit

Permalink
文中にHTTPSでのリンクの場合画像として認識していなかったエラーの修正 fix #92
Browse files Browse the repository at this point in the history
  • Loading branch information
Echos committed Oct 4, 2012
1 parent 4ec9dba commit b1ad5db
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion models/statement.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
require 'json'
require 'uri'
require 'net/http'
require 'net/https'
require 'picasa'

module Massr
Expand Down Expand Up @@ -61,7 +62,9 @@ def update_statement(request)
uri = URI.parse($&)
response = nil
begin
Net::HTTP.start( uri.host, uri.port ) do |http|
nethttp = Net::HTTP.new( uri.host, uri.port )
nethttp.use_ssl = true if uri.port == 443
nethttp.start do |http|
response = http.head( uri.request_uri )
self[:photos] << uri.to_s if response["content-type"].to_s.include?('image')
end
Expand Down

0 comments on commit b1ad5db

Please sign in to comment.