glebtv-httpclient 3.2.8 → 3.3.0
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 +5 -5
- data/Gemfile.lock +37 -52
- data/README.md +2 -3
- data/lib/httpclient/session.rb +6 -6
- data/lib/httpclient/version.rb +1 -1
- data/spec/httpclient_spec.rb +3 -3
- data/test/test_httpclient.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: c9ffbd1d6d65a599d654d899f1a2253e2c402aa7dd6113993cf2af5e00bae05b
|
4
|
+
data.tar.gz: f35bb6f33a7de1aa68ad516c759f3cd51d64caa1b3bc8164b34c2d065d9b55b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e990cee47554c0c29f40d6dc25e3444ad76ebd1b453f73381b1b1bd4ff08d5b2092927c6ed5632c66b210811376057f476bd5820c1914bc3344c945ca703dd2
|
7
|
+
data.tar.gz: 783b60d207f1c0be6737402bf03ae0a9b18da8d99fece4431ceb7effdd201d4cbc775f350d6e5e75593fe75def14f8baee055e76deb5d5c3eba933be68de624c
|
data/Gemfile.lock
CHANGED
@@ -1,65 +1,47 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
glebtv-httpclient (3.
|
4
|
+
glebtv-httpclient (3.3.0)
|
5
5
|
lru_redux
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: http://rubygems.org/
|
9
9
|
specs:
|
10
|
-
|
11
|
-
|
12
|
-
json (
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
minitest (5.4.0)
|
31
|
-
multi_json (1.10.1)
|
32
|
-
netrc (0.7.7)
|
33
|
-
rake (10.3.2)
|
34
|
-
rdoc (4.1.1)
|
35
|
-
json (~> 1.4)
|
36
|
-
rest-client (1.7.2)
|
37
|
-
mime-types (>= 1.16, < 3.0)
|
38
|
-
netrc (~> 0.7)
|
39
|
-
rspec (3.0.0)
|
40
|
-
rspec-core (~> 3.0.0)
|
41
|
-
rspec-expectations (~> 3.0.0)
|
42
|
-
rspec-mocks (~> 3.0.0)
|
43
|
-
rspec-core (3.0.3)
|
44
|
-
rspec-support (~> 3.0.0)
|
45
|
-
rspec-expectations (3.0.3)
|
10
|
+
climate_control (0.2.0)
|
11
|
+
coveralls (0.8.22)
|
12
|
+
json (>= 1.8, < 3)
|
13
|
+
simplecov (~> 0.16.1)
|
14
|
+
term-ansicolor (~> 1.3)
|
15
|
+
thor (~> 0.19.4)
|
16
|
+
tins (~> 1.6)
|
17
|
+
diff-lcs (1.3)
|
18
|
+
docile (1.3.1)
|
19
|
+
json (2.1.0)
|
20
|
+
lru_redux (1.1.0)
|
21
|
+
rake (12.3.2)
|
22
|
+
rdoc (6.1.1)
|
23
|
+
rspec (3.8.0)
|
24
|
+
rspec-core (~> 3.8.0)
|
25
|
+
rspec-expectations (~> 3.8.0)
|
26
|
+
rspec-mocks (~> 3.8.0)
|
27
|
+
rspec-core (3.8.0)
|
28
|
+
rspec-support (~> 3.8.0)
|
29
|
+
rspec-expectations (3.8.2)
|
46
30
|
diff-lcs (>= 1.2.0, < 2.0)
|
47
|
-
rspec-support (~> 3.
|
48
|
-
rspec-mocks (3.0
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
31
|
+
rspec-support (~> 3.8.0)
|
32
|
+
rspec-mocks (3.8.0)
|
33
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
34
|
+
rspec-support (~> 3.8.0)
|
35
|
+
rspec-support (3.8.0)
|
36
|
+
simplecov (0.16.1)
|
37
|
+
docile (~> 1.1)
|
38
|
+
json (>= 1.8, < 3)
|
39
|
+
simplecov-html (~> 0.10.0)
|
40
|
+
simplecov-html (0.10.2)
|
41
|
+
term-ansicolor (1.7.1)
|
57
42
|
tins (~> 1.0)
|
58
|
-
thor (0.19.
|
59
|
-
|
60
|
-
tins (1.3.0)
|
61
|
-
tzinfo (1.2.2)
|
62
|
-
thread_safe (~> 0.1)
|
43
|
+
thor (0.19.4)
|
44
|
+
tins (1.20.2)
|
63
45
|
|
64
46
|
PLATFORMS
|
65
47
|
ruby
|
@@ -72,3 +54,6 @@ DEPENDENCIES
|
|
72
54
|
rake
|
73
55
|
rdoc
|
74
56
|
rspec
|
57
|
+
|
58
|
+
BUNDLED WITH
|
59
|
+
2.0.1
|
data/README.md
CHANGED
@@ -2,9 +2,8 @@
|
|
2
2
|
|
3
3
|
I just try to make it work properly (as a browser would) for my use cases.
|
4
4
|
|
5
|
-
[](https://www.versioneye.com/user/projects/534eebc9fe0d0784f30008f6)
|
5
|
+
[](https://travis-ci.org/glebtv/httpclient)
|
6
|
+
[](http://badge.fury.io/rb/httpclient)
|
8
7
|
[](https://www.versioneye.com/user/projects/53e73f2b35080d699f000093)
|
9
8
|
|
10
9
|
If you don't like how something works, please send a PR or use original gem: https://github.com/nahi/httpclient
|
data/lib/httpclient/session.rb
CHANGED
@@ -621,7 +621,7 @@ class HTTPClient
|
|
621
621
|
# Use absolute URI (not absolute path) iif via proxy AND not HTTPS.
|
622
622
|
req.header.request_absolute_uri = !@proxy.nil? and !https?(@dest)
|
623
623
|
begin
|
624
|
-
timeout(@send_timeout, SendTimeoutError) do
|
624
|
+
Timeout.timeout(@send_timeout, SendTimeoutError) do
|
625
625
|
set_header(req)
|
626
626
|
req.dump(@socket)
|
627
627
|
# flush the IO stream as IO::sync mode is false
|
@@ -767,7 +767,7 @@ class HTTPClient
|
|
767
767
|
site = @proxy || @dest
|
768
768
|
retry_number = 0
|
769
769
|
begin
|
770
|
-
timeout(@connect_timeout, ConnectTimeoutError) do
|
770
|
+
Timeout.timeout(@connect_timeout, ConnectTimeoutError) do
|
771
771
|
@socket = create_socket(site)
|
772
772
|
if https?(@dest)
|
773
773
|
if @socket.is_a?(LoopBackSocket)
|
@@ -918,7 +918,7 @@ class HTTPClient
|
|
918
918
|
|
919
919
|
StatusParseRegexp = %r(\AHTTP/(\d+\.\d+)\s+(\d\d\d)\s*([^\r\n]+)?\r?\n\z)
|
920
920
|
def parse_header
|
921
|
-
timeout(@receive_timeout, ReceiveTimeoutError) do
|
921
|
+
Timeout.timeout(@receive_timeout, ReceiveTimeoutError) do
|
922
922
|
initial_line = nil
|
923
923
|
begin
|
924
924
|
begin
|
@@ -997,7 +997,7 @@ class HTTPClient
|
|
997
997
|
|
998
998
|
maxbytes = @read_block_size
|
999
999
|
maxbytes = @content_length if maxbytes > @content_length && @content_length > 0
|
1000
|
-
timeout(@receive_timeout, ReceiveTimeoutError) do
|
1000
|
+
Timeout.timeout(@receive_timeout, ReceiveTimeoutError) do
|
1001
1001
|
begin
|
1002
1002
|
@socket.readpartial(maxbytes, buf)
|
1003
1003
|
rescue EOFError
|
@@ -1031,7 +1031,7 @@ class HTTPClient
|
|
1031
1031
|
@socket.gets(RS)
|
1032
1032
|
return
|
1033
1033
|
end
|
1034
|
-
timeout(@receive_timeout, ReceiveTimeoutError) do
|
1034
|
+
Timeout.timeout(@receive_timeout, ReceiveTimeoutError) do
|
1035
1035
|
@socket.read(@chunk_length, buf)
|
1036
1036
|
@socket.read(2) # CRLF
|
1037
1037
|
end
|
@@ -1049,7 +1049,7 @@ class HTTPClient
|
|
1049
1049
|
while true
|
1050
1050
|
buf = HTTPClient::Util.get_buf
|
1051
1051
|
|
1052
|
-
timeout(@receive_timeout, ReceiveTimeoutError) do
|
1052
|
+
Timeout.timeout(@receive_timeout, ReceiveTimeoutError) do
|
1053
1053
|
begin
|
1054
1054
|
@socket.readpartial(@read_block_size, buf)
|
1055
1055
|
rescue EOFError
|
data/lib/httpclient/version.rb
CHANGED
data/spec/httpclient_spec.rb
CHANGED
@@ -76,7 +76,7 @@ describe 'HTTPClient' do
|
|
76
76
|
end
|
77
77
|
|
78
78
|
it "redirect returns not modified" do
|
79
|
-
timeout(2) do
|
79
|
+
Timeout.timeout(2) do
|
80
80
|
@client.get(@srv.u("status"), {:status => 306}, :follow_redirect => true)
|
81
81
|
end
|
82
82
|
end
|
@@ -86,7 +86,7 @@ describe 'HTTPClient' do
|
|
86
86
|
begin
|
87
87
|
@client.proxy = "http://"
|
88
88
|
rescue
|
89
|
-
expect($!.class.to_s).to match(/
|
89
|
+
expect($!.class.to_s).to match(/ArgumentError/)
|
90
90
|
end
|
91
91
|
@client.proxy = ""
|
92
92
|
expect(@client.proxy).to be_nil
|
@@ -442,7 +442,7 @@ hello"
|
|
442
442
|
end
|
443
443
|
|
444
444
|
it "no content" do
|
445
|
-
timeout(2) do
|
445
|
+
Timeout.timeout(2) do
|
446
446
|
@client.get(@srv.u("status"), :status => 101)
|
447
447
|
@client.get(@srv.u("status"), :status => 204)
|
448
448
|
@client.get(@srv.u("status"), :status => 304)
|
data/test/test_httpclient.rb
CHANGED
@@ -83,7 +83,7 @@ class TestHTTPClient < ActiveSupport::TestCase
|
|
83
83
|
|
84
84
|
def test_redirect_returns_not_modified
|
85
85
|
assert_nothing_raised do
|
86
|
-
timeout(2) do
|
86
|
+
Timeout.timeout(2) do
|
87
87
|
@client.get(serverurl + 'status', {:status => 306}, {:follow_redirect => true})
|
88
88
|
end
|
89
89
|
end
|
@@ -435,7 +435,7 @@ EOS
|
|
435
435
|
|
436
436
|
def test_no_content
|
437
437
|
assert_nothing_raised do
|
438
|
-
timeout(2) do
|
438
|
+
Timeout.timeout(2) do
|
439
439
|
@client.get(serverurl + 'status', :status => 101)
|
440
440
|
@client.get(serverurl + 'status', :status => 204)
|
441
441
|
@client.get(serverurl + 'status', :status => 304)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glebtv-httpclient
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- glebtv
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2019-01-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: lru_redux
|
@@ -221,7 +221,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
221
221
|
version: '0'
|
222
222
|
requirements: []
|
223
223
|
rubyforge_project:
|
224
|
-
rubygems_version: 2.
|
224
|
+
rubygems_version: 2.7.7
|
225
225
|
signing_key:
|
226
226
|
specification_version: 4
|
227
227
|
summary: Fork of httpclient with some fixes and patches I needed.
|