rack-proxy 0.5.11 → 0.5.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/lib/rack/proxy.rb +5 -4
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fa1eeee40a4a2a471d0abf266cd42aa5e00572ec
4
- data.tar.gz: 3406b4401ca57b11e7c708b8fb2ed3df283e578b
3
+ metadata.gz: 783a9409fc6e9ca368d9b6d890b72108be49f3b4
4
+ data.tar.gz: efd58224498b8716cb29c68dfcf4a7b279f8f065
5
5
  SHA512:
6
- metadata.gz: 8cb90c4be8fe668a0efc50f2db07961dbdaae002ba9f0e9887b3a4ab6345be34ff74ca7c0ad235ee1251ba2237e45d15af0b1dedca2055d3938cb6d3ec5501f5
7
- data.tar.gz: d667cd41f5b59725eea09980b11dc6a6f008f0f4953b7d13197f806dc7e6140bd56305e7b3a13c265ee74a6693ad80d720acdb303cc996ee5d67cd29c4643d9f
6
+ metadata.gz: b9a6c0b1cf2cea28e355aecdd16188c5cf34841f2fe68d1a209c4f95a57ba8292469d22b80390024764479db209039c1355920389f5ea56c028b43ea041a68fd
7
+ data.tar.gz: 9da6798ec4f37e85aad35a284f9b04b60cd92c0ba91c4eb3b73911efda48a7f10793c2d6f461254139883d21adea339e44435ca328a2b3e8f0c9f2ebaa2bc42f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rack-proxy (0.5.11)
4
+ rack-proxy (0.5.12)
5
5
  rack
6
6
 
7
7
  GEM
data/lib/rack/proxy.rb CHANGED
@@ -5,7 +5,7 @@ module Rack
5
5
 
6
6
  # Subclass and bring your own #rewrite_request and #rewrite_response
7
7
  class Proxy
8
- VERSION = "0.5.11"
8
+ VERSION = "0.5.12"
9
9
 
10
10
  class << self
11
11
  def extract_http_request_headers(env)
@@ -98,14 +98,15 @@ module Rack
98
98
  target_response.use_ssl = use_ssl
99
99
  target_response.verify_mode = OpenSSL::SSL::VERIFY_NONE if use_ssl && ssl_verify_none
100
100
  else
101
- target_response = Net::HTTP.start(backend.host, backend.port, :use_ssl => use_ssl) do |http|
102
- http.verify_mode = OpenSSL::SSL::VERIFY_NONE if use_ssl && ssl_verify_none
101
+ start_opts = use_ssl ? {:use_ssl => use_ssl} : {}
102
+ start_opts[:verify_mode] = OpenSSL::SSL::VERIFY_NONE if use_ssl && ssl_verify_none
103
+ target_response = Net::HTTP.start(backend.host, backend.port, start_opts) do |http|
103
104
  http.request(target_request)
104
105
  end
105
106
  end
106
107
 
107
108
  headers = (target_response.respond_to?(:headers) && target_response.headers) || self.class.normalize_headers(target_response.to_hash)
108
- body = target_response.body
109
+ body = target_response.body || [""]
109
110
  body = [body] unless body.respond_to?(:each)
110
111
 
111
112
  [target_response.code, headers, body]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-proxy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.11
4
+ version: 0.5.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jacek Becela
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-21 00:00:00.000000000 Z
11
+ date: 2014-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack