rack-request_replication 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 67e1924221a07e4198b2b44a035d2c0a25404c30
|
4
|
+
data.tar.gz: 2b828c7b292629ee757ab2028ff7d7571c0d0545
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14911f9384c7b0f69db66075f2cf268c04051d882426219ab28272bdbfa04c5bda1760fc4975277935bfd864960e670aad8c78b59871c595814414306a9052b9
|
7
|
+
data.tar.gz: 3fcf4cb6242c75e1ea6d0029fec4beb88d76748f4142436121636db654d1025dbf91e732d948575ad62216de72876e7c9d1dc5aa219834c26a5dfb890fc70041
|
@@ -24,6 +24,9 @@ module Rack
|
|
24
24
|
# @option options [String] :session_key ('rack.session')
|
25
25
|
# @option options [Bool] :use_ssl (false)
|
26
26
|
# @option options [Bool] :verify_ssl (true)
|
27
|
+
# @option options [Hash{Symbol => Object}] :basic_auth
|
28
|
+
# @option basic_auth [String] :user
|
29
|
+
# @option basic_auth [String] :password
|
27
30
|
# @option options [Hash{Symbol => Object}] :redis
|
28
31
|
# @option redis [String] :host ('localhost')
|
29
32
|
# @option redis [Integer] :port (6379)
|
@@ -64,14 +67,18 @@ module Rack
|
|
64
67
|
uri = forward_uri request
|
65
68
|
|
66
69
|
http = Net::HTTP.new uri.host, uri.port
|
67
|
-
http.use_ssl =
|
68
|
-
http.verify_mode = OpenSSL::SSL::VERIFY_NONE unless
|
70
|
+
http.use_ssl = options[:use_ssl]
|
71
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE unless options[:verify_ssl]
|
69
72
|
|
70
73
|
forward_request = send("create_#{opts[:request_method].downcase}_request", uri, opts)
|
71
74
|
forward_request.add_field("Accept", opts[:accept])
|
72
75
|
forward_request.add_field("Accept-Encoding", opts[:accept_encoding])
|
73
76
|
forward_request.add_field("Host", request.host)
|
74
77
|
|
78
|
+
if options[:basic_auth]
|
79
|
+
forward_request.basic_auth options[:basic_auth][:user], options[:basic_auth][:password]
|
80
|
+
end
|
81
|
+
|
75
82
|
Thread.new do
|
76
83
|
begin
|
77
84
|
forward_request.add_field("Cookie", cookies( request ))
|