httpclient 2.2.2 → 2.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/httpclient/http.rb +1 -1
- data/lib/httpclient/version.rb +1 -1
- data/test/test_httpclient.rb +6 -6
- metadata +3 -3
data/lib/httpclient/http.rb
CHANGED
@@ -975,7 +975,7 @@ module HTTP
|
|
975
975
|
# headers like 'Set-Cookie'. Use header['Set-Cookie'] for that purpose.
|
976
976
|
# (It returns an Array always)
|
977
977
|
def headers
|
978
|
-
Hash[http_header.all]
|
978
|
+
Hash[*http_header.all.flatten]
|
979
979
|
end
|
980
980
|
|
981
981
|
# Extracts cookies from 'Set-Cookie' header.
|
data/lib/httpclient/version.rb
CHANGED
data/test/test_httpclient.rb
CHANGED
@@ -1273,24 +1273,24 @@ EOS
|
|
1273
1273
|
end
|
1274
1274
|
}
|
1275
1275
|
# allocate 10 keep-alive connections
|
1276
|
-
10.
|
1276
|
+
(0...10).to_a.map {
|
1277
1277
|
Thread.new {
|
1278
1278
|
assert_equal("12345", client.get(endpoint).content)
|
1279
1279
|
}
|
1280
|
-
}.each
|
1280
|
+
}.each { |th| th.join }
|
1281
1281
|
# send 5 requests, which should get KeepAliveDesconnected.
|
1282
1282
|
# doing these requests, rest keep-alive connections are invalidated.
|
1283
|
-
5.
|
1283
|
+
(0...5).to_a.map {
|
1284
1284
|
Thread.new {
|
1285
1285
|
assert_equal("23456", client.get(endpoint).content)
|
1286
1286
|
}
|
1287
|
-
}.each
|
1287
|
+
}.each { |th| th.join }
|
1288
1288
|
# rest requests won't get KeepAliveDisconnected; how can I check this?
|
1289
|
-
10.
|
1289
|
+
(0...10).to_a.map {
|
1290
1290
|
Thread.new {
|
1291
1291
|
assert_equal("34567", client.get(endpoint).content)
|
1292
1292
|
}
|
1293
|
-
}.each
|
1293
|
+
}.each { |th| th.join }
|
1294
1294
|
end
|
1295
1295
|
|
1296
1296
|
def create_keepalive_thread(count, sock)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: httpclient
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-10-
|
12
|
+
date: 2011-10-28 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description:
|
15
15
|
email: nahi@ruby-lang.org
|
@@ -88,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
88
88
|
version: '0'
|
89
89
|
requirements: []
|
90
90
|
rubyforge_project:
|
91
|
-
rubygems_version: 1.8.
|
91
|
+
rubygems_version: 1.8.11
|
92
92
|
signing_key:
|
93
93
|
specification_version: 3
|
94
94
|
summary: gives something like the functionality of libwww-perl (LWP) in Ruby
|