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: bdbbf781ea322294ddfb8c4b47da266c6472db2b
4
- data.tar.gz: c55ebd25db87a9ba5880051ca629670019c3fb1f
3
+ metadata.gz: 67e1924221a07e4198b2b44a035d2c0a25404c30
4
+ data.tar.gz: 2b828c7b292629ee757ab2028ff7d7571c0d0545
5
5
  SHA512:
6
- metadata.gz: d58dbc84e1667a0caf66a1e1a743b87fe2467a84e386f69145dbf9cade5813c7b6b38d58feeef21f24bda1e13792e232ba9decb3cf19e03e741b158a82aaeede
7
- data.tar.gz: 40f0c2ce13816b5a1c3d173b9063ef90c7e3fc9a814f5185f64ee0557c50ab17076dcb4091ee4d404f606f2f3bdee57d6a37a8f8c9a5be44b9e07af919e7930e
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 = @options[:use_ssl]
68
- http.verify_mode = OpenSSL::SSL::VERIFY_NONE unless @options[:verify_ssl]
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 ))
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  module RequestReplication
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-request_replication
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wouter de Vos