net-http-persistent 2.3 → 2.3.1

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
Binary file
data/History.txt CHANGED
@@ -1,3 +1,10 @@
1
+ === 2.3.1 / 2011-10-26
2
+
3
+ * Bug fix
4
+ * If a request object already contains a Connection header it will no longer
5
+ be overridden. This allows keep-alive connections to be disabled on a
6
+ per-request basis.
7
+
1
8
  === 2.3 / 2011-10-25
2
9
 
3
10
  * Minor Enhancement
@@ -149,7 +149,7 @@ class Net::HTTP::Persistent
149
149
  ##
150
150
  # The version of Net::HTTP::Persistent you are using
151
151
 
152
- VERSION = '2.3'
152
+ VERSION = '2.3.1'
153
153
 
154
154
  ##
155
155
  # Error class for errors raised by Net::HTTP::Persistent. Various
@@ -576,8 +576,10 @@ class Net::HTTP::Persistent
576
576
  req.add_field(*pair)
577
577
  end
578
578
 
579
- req.add_field 'Connection', 'keep-alive'
580
- req.add_field 'Keep-Alive', @keep_alive
579
+ unless req['Connection'] then
580
+ req.add_field 'Connection', 'keep-alive'
581
+ req.add_field 'Keep-Alive', @keep_alive
582
+ end
581
583
 
582
584
  connection = connection_for uri
583
585
  connection_id = connection.object_id
@@ -629,6 +629,23 @@ class TestNetHttpPersistent < MiniTest::Unit::TestCase
629
629
  assert_equal 1, reqs[c.object_id]
630
630
  end
631
631
 
632
+ def test_request_connection
633
+ c = connection
634
+
635
+ request = Net::HTTP::Get.new @uri.request_uri
636
+ request['connection'] = 'close'
637
+
638
+ res = @http.request @uri, request
639
+ req = c.req
640
+
641
+ assert_kind_of Net::HTTPResponse, res
642
+
643
+ assert_kind_of Net::HTTP::Get, req
644
+ assert_equal '/path', req.path
645
+ assert_equal 'close', req['connection']
646
+ assert_equal nil, req['keep-alive']
647
+ end
648
+
632
649
  def test_request_invalid
633
650
  c = basic_connection
634
651
  def c.request(*a) raise Errno::EINVAL, "write" end
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: net-http-persistent
3
3
  version: !ruby/object:Gem::Version
4
- hash: 5
4
+ hash: 1
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 3
9
- version: "2.3"
9
+ - 1
10
+ version: 2.3.1
10
11
  platform: ruby
11
12
  authors:
12
13
  - Eric Hodel
@@ -35,7 +36,7 @@ cert_chain:
35
36
  x52qPcexcYZR7w==
36
37
  -----END CERTIFICATE-----
37
38
 
38
- date: 2011-10-25 00:00:00 Z
39
+ date: 2011-10-27 00:00:00 Z
39
40
  dependencies:
40
41
  - !ruby/object:Gem::Dependency
41
42
  name: minitest
metadata.gz.sig CHANGED
Binary file