This commit is contained in:
chiu 2020-12-27 22:36:51 +08:00
parent af8e3bc214
commit 6343fb00d3
1 changed files with 5 additions and 2 deletions

View File

@ -100,9 +100,12 @@ class Admin::FeedsController < OrbitAdminController
puts url
uri = URI.parse(URI.decode(url).encode)
begin
res = Timeout.timeout(10){Net::HTTP.get_response(uri).body}
res = Timeout.timeout(10){Net::HTTP.get_response(uri).body}
rescue
res = nil
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true if (uri.scheme == "https")
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
res = http.get(uri.request_uri).body rescue nil
puts uri.to_s
puts uri.hostname
end