mirror of
https://github.com/seejohnrun/haste-client.git
synced 2025-12-15 16:25:57 +00:00
Merge pull request #12 from sairez/master
add ability to use SSL to contact haste-server
This commit is contained in:
@@ -26,6 +26,10 @@ module Haste
|
|||||||
def start
|
def start
|
||||||
uri = URI.parse server
|
uri = URI.parse server
|
||||||
http = Net::HTTP.new uri.host, uri.port
|
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
|
response = http.post '/documents', @input
|
||||||
if response.is_a?(Net::HTTPOK)
|
if response.is_a?(Net::HTTPOK)
|
||||||
data = JSON.parse(response.body)
|
data = JSON.parse(response.body)
|
||||||
|
|||||||
Reference in New Issue
Block a user