mirror of
https://github.com/seejohnrun/haste-client.git
synced 2025-12-12 23:05:56 +00:00
simplify ssl support
This commit is contained in:
@@ -25,12 +25,10 @@ module Haste
|
|||||||
# Upload the and output the URL we get back
|
# Upload the and output the URL we get back
|
||||||
def start
|
def start
|
||||||
uri = URI.parse server
|
uri = URI.parse server
|
||||||
|
http = Net::HTTP.new uri.host, uri.port
|
||||||
if uri.scheme =~ /^https/
|
if uri.scheme =~ /^https/
|
||||||
http = Net::HTTP.new uri.host, uri.port
|
|
||||||
http.use_ssl = true
|
http.use_ssl = true
|
||||||
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
||||||
else
|
|
||||||
http = Net::HTTP.new uri.host, uri.port
|
|
||||||
end
|
end
|
||||||
response = http.post '/documents', @input
|
response = http.post '/documents', @input
|
||||||
if response.is_a?(Net::HTTPOK)
|
if response.is_a?(Net::HTTPOK)
|
||||||
|
|||||||
Reference in New Issue
Block a user