rack-proxy 0.6.1 → 0.6.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: 84a7e47d9d9290e0474f2c38b0d97e53384c7f0e
4
- data.tar.gz: d986965dab7d2e31680add8c8e658ac39d97e262
3
+ metadata.gz: d347e8178e678199e2c0909de87bbdbaca03f35e
4
+ data.tar.gz: f410d801a63f97afd6076e6ea76ab0befeb0d1b6
5
5
  SHA512:
6
- metadata.gz: 2a63c04886cbfb4c0e038e3289fb768911f534bbbd9057862828065bcbfd3d6b570332da4c96f011fd4599486bfe820fcb483d7378e8d35a983542459d6759e4
7
- data.tar.gz: b5dd8b75c14cd5857af98b2fac762f6cf9416a59138a12ee69a22c8ba57ffbf345000a4acf1f2555bfdbefc3c0f5504a0a3a86dcc746262e36954ecc4d08dc2a
6
+ metadata.gz: a810cef5273abe06ac5291ef502d4b473692c4334768b6620a2cde6ed3ff45247b25867fa187b1827257d5081a240de3ae5b755249fe6ec4f565c65387c92242
7
+ data.tar.gz: 570c6d53c3435b775d81ec49fc37b7c9b7045fae128936283fe21838fad04dd7a8320287df8840b3bf7fd2be22402143a5c2e3cf347185b93c0703f96bcb877f
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rack-proxy (0.6.1)
4
+ rack-proxy (0.6.2)
5
5
  rack
6
6
 
7
7
  GEM
@@ -25,4 +25,4 @@ DEPENDENCIES
25
25
  test-unit
26
26
 
27
27
  BUNDLED WITH
28
- 1.14.6
28
+ 1.15.1
data/README.md CHANGED
@@ -1,5 +1,20 @@
1
1
  A request/response rewriting HTTP proxy. A Rack app. Subclass `Rack::Proxy` and provide your `rewrite_env` and `rewrite_response` methods.
2
2
 
3
+ Installation
4
+ -------
5
+
6
+ Add the following to your Gemfile:
7
+
8
+ ```
9
+ gem 'rack-proxy', '~> 0.6.2'
10
+ ```
11
+
12
+ Or install:
13
+
14
+ ```
15
+ gem install rack-proxy
16
+ ```
17
+
3
18
  Example
4
19
  -------
5
20
 
@@ -1,5 +1,5 @@
1
1
  # We are hacking net/http to change semantics of streaming handling
2
- # from "block" semantics to regular "return" semnatics.
2
+ # from "block" semantics to regular "return" semantics.
3
3
  # We need it to construct a streamable rack triplet:
4
4
  #
5
5
  # [status, headers, streamable_body]
@@ -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.6.1"
8
+ VERSION = "0.6.2"
9
9
 
10
10
  class << self
11
11
  def extract_http_request_headers(env)
@@ -121,6 +121,9 @@ module Rack
121
121
  body = target_response.body || [""]
122
122
  body = [body] unless body.respond_to?(:each)
123
123
 
124
+ # According to https://tools.ietf.org/html/draft-ietf-httpbis-p1-messaging-14#section-7.1.3.1Acc
125
+ # should remove hop-by-hop header fields
126
+ headers.reject! { |k| ['connection', 'keep-alive', 'proxy-authenticate', 'proxy-authorization', 'te', 'trailer', 'transfer-encoding', 'upgrade'].include? k.downcase }
124
127
  [target_response.code, headers, body]
125
128
  end
126
129
 
@@ -115,4 +115,10 @@ class RackProxyTest < Test::Unit::TestCase
115
115
  post "/", nil, "CONTENT_LENGTH" => nil
116
116
  end
117
117
  end
118
+
119
+ def test_response_header_included_Hop_by_hop
120
+ app({:streaming => true}).host = 'auth.goeasyship.com'
121
+ get 'https://example.com/oauth2/token/info?access_token=123'
122
+ assert !last_response.headers.key?('transfer-encoding')
123
+ end
118
124
  end
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.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jacek Becela
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-04 00:00:00.000000000 Z
11
+ date: 2017-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack