I need an application to block an HTTP request so I had to add a couple of lines of code, the only piece I couldn't figure out was the statement if uri.scheme == 'https'; http.use_ssl = true
is there a way I can set http/https in the current statement:
Net::HTTP.new(uri.host, uri.port).start do |http|
# Causes and IOError...
if uri.scheme == 'https'
http.use_ssl = true
end
request = Net::HTTP::Get.new(uri.request_uri)
http.request(request)
end
Added: IOError: use_ssl value changed, but session already started