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.
- checksums.yaml +4 -4
- data/lib/pretty_proxy.rb +4 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 27a4a136e6f248d4c8387db6771d1ced2528b2b0
|
4
|
+
data.tar.gz: 41cb52571d3925af1a7e4e5d38a7d18591ef99d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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.
|
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-
|
11
|
+
date: 2013-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|