net-http-persistent 2.6 → 2.7

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
Binary file
@@ -1,4 +1,10 @@
1
- === 2.6 / 2010-03-26
1
+ === 2.7 / 2012-06-06
2
+
3
+ * Minor enhancement
4
+ * Added JRuby compatibility by default for HTTPS connections. (JRuby lacks
5
+ OpenSSL::SSL::Session.)
6
+
7
+ === 2.6 / 2012-03-26
2
8
 
3
9
  * Minor enhancement
4
10
  * Net::HTTP::Persistent#idle_timeout may be set to nil to disable expiration
@@ -176,7 +176,7 @@ class Net::HTTP::Persistent
176
176
  ##
177
177
  # The version of Net::HTTP::Persistent you are using
178
178
 
179
- VERSION = '2.6'
179
+ VERSION = '2.7'
180
180
 
181
181
  ##
182
182
  # Error class for errors raised by Net::HTTP::Persistent. Various
@@ -404,7 +404,7 @@ class Net::HTTP::Persistent
404
404
 
405
405
  @generation = 0 # incremented when proxy URI changes
406
406
  @ssl_generation = 0 # incremented when SSL session variables change
407
- @reuse_ssl_sessions = true
407
+ @reuse_ssl_sessions = OpenSSL::SSL.const_defined? :Session
408
408
 
409
409
  @retry_change_requests = false
410
410
 
@@ -141,6 +141,10 @@ class TestNetHttpPersistent < MiniTest::Unit::TestCase
141
141
 
142
142
  def test_initialize
143
143
  assert_nil @http.proxy_uri
144
+
145
+ ssl_session_exists = OpenSSL::SSL.const_defined? :Session
146
+
147
+ assert_equal ssl_session_exists, @http.reuse_ssl_sessions
144
148
  end
145
149
 
146
150
  def test_initialize_name
@@ -148,6 +152,21 @@ class TestNetHttpPersistent < MiniTest::Unit::TestCase
148
152
  assert_equal 'name', http.name
149
153
  end
150
154
 
155
+ def test_initialize_no_ssl_session
156
+ skip "OpenSSL::SSL::Session does not exist on #{RUBY_PLATFORM}" unless
157
+ OpenSSL::SSL.const_defined? :Session
158
+
159
+ ssl_session = OpenSSL::SSL::Session
160
+
161
+ OpenSSL::SSL.send :remove_const, :Session
162
+
163
+ http = Net::HTTP::Persistent.new
164
+
165
+ refute http.reuse_ssl_sessions
166
+ ensure
167
+ OpenSSL::SSL.const_set :Session, ssl_session if ssl_session
168
+ end
169
+
151
170
  def test_initialize_proxy
152
171
  proxy_uri = URI.parse 'http://proxy.example'
153
172
 
metadata CHANGED
@@ -1,12 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: net-http-persistent
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
- - 6
9
- version: "2.6"
8
+ - 7
9
+ version: "2.7"
10
10
  platform: ruby
11
11
  authors:
12
12
  - Eric Hodel
@@ -36,7 +36,7 @@ cert_chain:
36
36
  U81zGHMUBOvz/VGT6wJwYJ3emS2nfA2NOHFfgA==
37
37
  -----END CERTIFICATE-----
38
38
 
39
- date: 2012-03-26 00:00:00 Z
39
+ date: 2012-06-06 00:00:00 Z
40
40
  dependencies:
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: minitest
@@ -76,11 +76,11 @@ dependencies:
76
76
  requirements:
77
77
  - - ~>
78
78
  - !ruby/object:Gem::Version
79
- hash: 35
79
+ hash: 7
80
80
  segments:
81
- - 2
82
- - 16
83
- version: "2.16"
81
+ - 3
82
+ - 0
83
+ version: "3.0"
84
84
  type: :development
85
85
  version_requirements: *id003
86
86
  description: |-
metadata.gz.sig CHANGED
Binary file