lib/rack/http_streaming_response.rb in rack-proxy-0.3.4 vs lib/rack/http_streaming_response.rb in rack-proxy-0.3.5
- old
+ new
@@ -2,10 +2,12 @@
module Rack
# Wraps the hacked net/http in a Rack way.
class HttpStreamingResponse
+ attr_accessor :use_ssl
+
def initialize(request, host, port = nil)
@request, @host, @port = request, host, port
end
def status
@@ -52,10 +54,14 @@
@response ||= session.begin_request_hacked(@request)
end
# Net::HTTP
def session
- @session ||= Net::HTTP.start(@host, @port)
+ @session ||= begin
+ http = Net::HTTP.new @host, @port
+ http.use_ssl = self.use_ssl
+ http.start
+ end
end
end
end