Permalink
Browse files

Added when to use https

  • Loading branch information...
1 parent 571a46f commit 0dae2c492b2d3e4b4a46710934900b43a505b824 makuchaku committed Aug 20, 2011
Showing with 5 additions and 2 deletions.
  1. +5 −2 bridge.rb
View
@@ -2,7 +2,7 @@
require 'sinatra'
require "uri"
require 'net/http'
-#require 'net/https'
+require 'net/https'
require 'json'
@@ -32,7 +32,10 @@
request.body = params['b'] if params['b']
http = Net::HTTP.new(url.host, url.port)
- #http.use_ssl = false
+
+ # Know when to use https
+ http.use_ssl = true if url.scheme == "https"
+
response = http.start do |http|
http.request(request)
end

0 comments on commit 0dae2c4

Please sign in to comment.