1
0
mirror of https://github.com/seejohnrun/haste-client.git synced 2025-12-12 23:05:56 +00:00

Merge pull request #12 from sairez/master

add ability to use SSL to contact haste-server
This commit is contained in:
John Crepezzi
2013-04-08 08:58:18 -07:00

View File

@@ -26,6 +26,10 @@ module Haste
def start
uri = URI.parse server
http = Net::HTTP.new uri.host, uri.port
if uri.scheme =~ /^https/
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
end
response = http.post '/documents', @input
if response.is_a?(Net::HTTPOK)
data = JSON.parse(response.body)