rack-proxy 0.7.7 → 0.7.8
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 +4 -4
- data/Gemfile.lock +3 -2
- data/lib/rack/proxy.rb +1 -1
- data/test/http_streaming_response_test.rb +5 -3
- data/test/rack_proxy_test.rb +7 -6
- metadata +3 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6f1a4b368973c939e40b8f152e168081d55105a2a447541d2ea8a2b9157aaf65
|
|
4
|
+
data.tar.gz: f24595aef9a2aeaa8354f0377d1f28508f248039a59a880f1da674891e6236af
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5fa9ddee2ccb22bdeb051dc11bf09aa158a93ebf3d95156ae43bea1fb933527e9bb31cf60910d063017c229e599aaa20d7452c792bc2b7f0303da8f20c579bbc
|
|
7
|
+
data.tar.gz: 8d95e69cfb5e09c3e4103653bd739e96b37430f7e92720c668a8f396458f07fbeec9e01b25a6b4cff8128ad958f64d3adc01f748a3836f2ea768f8cc60d74244
|
data/Gemfile.lock
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
rack-proxy (0.7.
|
|
4
|
+
rack-proxy (0.7.8)
|
|
5
5
|
rack
|
|
6
6
|
|
|
7
7
|
GEM
|
|
8
8
|
remote: https://rubygems.org/
|
|
9
9
|
specs:
|
|
10
10
|
power_assert (2.0.3)
|
|
11
|
-
rack (3.0.
|
|
11
|
+
rack (3.0.9.1)
|
|
12
12
|
rack-test (2.1.0)
|
|
13
13
|
rack (>= 1.3)
|
|
14
14
|
rake (13.0.6)
|
|
@@ -17,6 +17,7 @@ GEM
|
|
|
17
17
|
|
|
18
18
|
PLATFORMS
|
|
19
19
|
arm64-darwin-22
|
|
20
|
+
x86_64-linux
|
|
20
21
|
|
|
21
22
|
DEPENDENCIES
|
|
22
23
|
rack-proxy!
|
data/lib/rack/proxy.rb
CHANGED
|
@@ -19,9 +19,8 @@ class HttpStreamingResponseTest < Test::Unit::TestCase
|
|
|
19
19
|
|
|
20
20
|
assert headers.size.positive?
|
|
21
21
|
|
|
22
|
-
assert_match %r{text/html
|
|
22
|
+
assert_match %r{text/html}, headers["content-type"].first.downcase
|
|
23
23
|
assert_equal headers["content-type"], headers["CoNtEnT-TyPe"]
|
|
24
|
-
assert headers["content-length"].first.to_i.positive?
|
|
25
24
|
|
|
26
25
|
# Body
|
|
27
26
|
chunks = []
|
|
@@ -37,7 +36,10 @@ class HttpStreamingResponseTest < Test::Unit::TestCase
|
|
|
37
36
|
end
|
|
38
37
|
|
|
39
38
|
def test_to_s
|
|
40
|
-
|
|
39
|
+
body_string = @response.body.to_s
|
|
40
|
+
assert body_string.bytesize.positive?
|
|
41
|
+
content_length = @response.headers["Content-Length"]
|
|
42
|
+
assert_equal content_length.first.to_i, body_string.bytesize if content_length
|
|
41
43
|
end
|
|
42
44
|
|
|
43
45
|
def test_to_s_called_twice
|
data/test/rack_proxy_test.rb
CHANGED
|
@@ -31,9 +31,9 @@ class RackProxyTest < Test::Unit::TestCase
|
|
|
31
31
|
|
|
32
32
|
def test_http_full_request_headers
|
|
33
33
|
app(:streaming => false)
|
|
34
|
-
app.host = '
|
|
35
|
-
get "/"
|
|
36
|
-
assert !Array(last_response['Set-Cookie']).empty?, '
|
|
34
|
+
app.host = 'httpbin.org'
|
|
35
|
+
get "/cookies/set?test=1"
|
|
36
|
+
assert !Array(last_response['Set-Cookie']).empty?, 'httpbin.org/cookies/set should set a cookie'
|
|
37
37
|
end
|
|
38
38
|
|
|
39
39
|
def test_https_streaming
|
|
@@ -44,7 +44,7 @@ class RackProxyTest < Test::Unit::TestCase
|
|
|
44
44
|
end
|
|
45
45
|
|
|
46
46
|
def test_https_streaming_tls
|
|
47
|
-
app(:ssl_version => :
|
|
47
|
+
app(:ssl_version => :TLSv1_2).host = 'www.apple.com'
|
|
48
48
|
get 'https://example.com'
|
|
49
49
|
assert last_response.ok?
|
|
50
50
|
assert_match(/(itunes|iphone|ipod|mac|ipad)/, last_response.body)
|
|
@@ -58,7 +58,7 @@ class RackProxyTest < Test::Unit::TestCase
|
|
|
58
58
|
end
|
|
59
59
|
|
|
60
60
|
def test_https_full_request_tls
|
|
61
|
-
app({:streaming => false, :ssl_version => :
|
|
61
|
+
app({:streaming => false, :ssl_version => :TLSv1_2}).host = 'www.apple.com'
|
|
62
62
|
get 'https://example.com'
|
|
63
63
|
assert last_response.ok?
|
|
64
64
|
assert_match(/(itunes|iphone|ipod|mac|ipad)/, last_response.body)
|
|
@@ -69,7 +69,8 @@ class RackProxyTest < Test::Unit::TestCase
|
|
|
69
69
|
headers = { 'header_array' => ['first_entry'], 'header_non_array' => :entry }
|
|
70
70
|
|
|
71
71
|
normalized_headers = proxy_class.send(:normalize_headers, headers)
|
|
72
|
-
|
|
72
|
+
expected_class = Rack.const_defined?(:Headers) ? Rack::Headers : Rack::Utils::HeaderHash
|
|
73
|
+
assert normalized_headers.instance_of?(expected_class)
|
|
73
74
|
assert normalized_headers['header_array'] == 'first_entry'
|
|
74
75
|
assert normalized_headers['header_non_array'] == :entry
|
|
75
76
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rack-proxy
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.7.
|
|
4
|
+
version: 0.7.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jacek Becela
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: rack
|
|
@@ -85,7 +84,6 @@ homepage: https://github.com/ncr/rack-proxy
|
|
|
85
84
|
licenses:
|
|
86
85
|
- MIT
|
|
87
86
|
metadata: {}
|
|
88
|
-
post_install_message:
|
|
89
87
|
rdoc_options: []
|
|
90
88
|
require_paths:
|
|
91
89
|
- lib
|
|
@@ -100,8 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
100
98
|
- !ruby/object:Gem::Version
|
|
101
99
|
version: '0'
|
|
102
100
|
requirements: []
|
|
103
|
-
rubygems_version: 3.
|
|
104
|
-
signing_key:
|
|
101
|
+
rubygems_version: 3.6.9
|
|
105
102
|
specification_version: 4
|
|
106
103
|
summary: A request/response rewriting HTTP proxy. A Rack app.
|
|
107
104
|
test_files:
|