pretty_proxy 4.0.3 → 4.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/pretty_proxy.rb +4 -3
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6804fcfab00c1c5d7d20edd6cbd858d77f9d35cf
4
- data.tar.gz: d00b3089384e101ac1ba779565240c55e062a463
3
+ metadata.gz: 27a4a136e6f248d4c8387db6771d1ced2528b2b0
4
+ data.tar.gz: 41cb52571d3925af1a7e4e5d38a7d18591ef99d3
5
5
  SHA512:
6
- metadata.gz: de9f24b5ad7cd410f34fbebc42211e1cdeb165efd42464bc9c74e1e6174f6a39d107323a68701f360ebe68bc06c3eb1edbc5c99af850753ee02f22ec351dd648
7
- data.tar.gz: 9b32cca11bdfecbf5275a83addc95a33ccc22292fc5e095eed1204e5ac9066c92fa5c280e14716ba216bb08afb8f11ea88932a37400d8e93dbd9f3f5b66a9b4f
6
+ metadata.gz: dc00bc884700fe862fd771630f3284bc7d552ebeb4fd1f7f35916e9bd37e31c718c475200ae23326f2feef296f122e94349b3538e24c0c60d2f100bab1eaa1bf
7
+ data.tar.gz: 404cd41a97b133aabc01c65dfc12da33485e022ccacc6b4cad96d93e040fd87c97a1ce01464431639281f064c7d78c79e5e6b834b15ca70a4c4030f8f2149e26
data/lib/pretty_proxy.rb CHANGED
@@ -286,7 +286,7 @@ class PrettyProxy < Rack::Proxy
286
286
  # identity. Change the 'content-length' header for the new body bytesize.
287
287
  # Remove the 'transfer-encoding' if it is chunked, and act as not chunked.
288
288
  # This method is inherited of Rack::Proxy, but in the original it have only
289
- # the first parameter (the triplet). This version have the request Rack env
289
+ # the first parameter (the triplet). This version have the Rack env requested
290
290
  # to the proxy and the rewritten Rack env as second and third parameters,
291
291
  # respectively.
292
292
  # @param triplet [Array<(Integer, Hash{String => String}, #each)>] A Rack
@@ -302,8 +302,9 @@ class PrettyProxy < Rack::Proxy
302
302
  def rewrite_response(triplet, requested_to_proxy_env, rewritten_env)
303
303
  status, headers, body = triplet
304
304
  content_type = headers['content-type']
305
- return triplet unless %r{text/html} =~ content_type ||
306
- %r{application/xhtml\+xml} =~ content_type
305
+ return triplet unless 200 == status && (%r{text/html} =~ content_type ||
306
+ %r{application/xhtml\+xml} =~ content_type)
307
+
307
308
 
308
309
  # the #each method of body can't be called twice, but we need to call it here and it is called
309
310
  # after this method return, so we fake the body with a array of one string
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pretty_proxy
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.3
4
+ version: 4.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henrique Becker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-19 00:00:00.000000000 Z
11
+ date: 2013-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri