rack-proxy 0.5.12 → 0.5.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 783a9409fc6e9ca368d9b6d890b72108be49f3b4
4
- data.tar.gz: efd58224498b8716cb29c68dfcf4a7b279f8f065
3
+ metadata.gz: f7c71d8f5f093330b71efd20ec95ce541c396b16
4
+ data.tar.gz: 1a5584b604965a50245ab35caf7da811c33a2fe4
5
5
  SHA512:
6
- metadata.gz: b9a6c0b1cf2cea28e355aecdd16188c5cf34841f2fe68d1a209c4f95a57ba8292469d22b80390024764479db209039c1355920389f5ea56c028b43ea041a68fd
7
- data.tar.gz: 9da6798ec4f37e85aad35a284f9b04b60cd92c0ba91c4eb3b73911efda48a7f10793c2d6f461254139883d21adea339e44435ca328a2b3e8f0c9f2ebaa2bc42f
6
+ metadata.gz: 98a8805b4ae8e3c86c24c780b958a3095fb0ea1bd86eec1c103ee9634e9a8ebdb5ba62c49af6a75687902b7793c71221a12618f912f936cd36aab4884f1ef76d
7
+ data.tar.gz: e77ed4762415ff980601d2c33f82d08e7d257088c60360323846a304e1df91d82cd81585b5dc65c8e185a03ceb96041f7ed6e84d82012ce8ebd08a17206025d2
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rack-proxy (0.5.12)
4
+ rack-proxy (0.5.13)
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.12"
8
+ VERSION = "0.5.13"
9
9
 
10
10
  class << self
11
11
  def extract_http_request_headers(env)
@@ -26,7 +26,7 @@ module Rack
26
26
 
27
27
  def normalize_headers(headers)
28
28
  mapped = headers.map do|k, v|
29
- [k, if v.is_a? Array then v.first else v end]
29
+ [k, if v.is_a? Array then v.join("\n") else v end]
30
30
  end
31
31
  Hash[mapped]
32
32
  end
@@ -84,9 +84,6 @@ module Rack
84
84
  target_request.body_stream.rewind
85
85
  end
86
86
 
87
- # Create a streaming response (the actual network communication is deferred, a.k.a. streamed)
88
- target_response = HttpStreamingResponse.new(target_request, source_request.host, source_request.port)
89
-
90
87
  backend = @backend || source_request
91
88
  use_ssl = backend.scheme == "https"
92
89
  ssl_verify_none = (env.delete('rack.ssl_verify_none') || @ssl_verify_none) == true
@@ -73,6 +73,17 @@ class RackProxyTest < Test::Unit::TestCase
73
73
  assert !headers.key?('NOT-HTTP-HEADER')
74
74
  end
75
75
 
76
+ def test_duplicate_headers
77
+ proxy_class = Rack::Proxy
78
+ env = { 'Set-Cookie' => ["cookie1=foo", "cookie2=bar"] }
79
+
80
+ headers = proxy_class.normalize_headers(env)
81
+ assert headers['Set-Cookie'].include?('cookie1=foo'), "Include the first value"
82
+ assert headers['Set-Cookie'].include?("\n"), "Join multiple cookies with newlines"
83
+ assert headers['Set-Cookie'].include?('cookie2=bar'), "Include the second value"
84
+ end
85
+
86
+
76
87
  def test_handles_missing_content_length
77
88
  assert_nothing_thrown do
78
89
  post "/", nil, "CONTENT_LENGTH" => nil
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.12
4
+ version: 0.5.13
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-24 00:00:00.000000000 Z
11
+ date: 2014-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack