excon 0.16.9 → 0.16.10

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of excon might be problematic. Click here for more details.

@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- excon (0.16.9)
4
+ excon (0.16.10)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
@@ -1,3 +1,9 @@
1
+ 0.16.10 11/16/2012
2
+ ==================
3
+
4
+ set default request_params for stub
5
+ do not attempt to read body for CONNECT requests
6
+
1
7
  0.16.9 11/16/2012
2
8
  =================
3
9
 
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
13
13
  ## If your rubyforge_project name is different, then edit it and comment out
14
14
  ## the sub! line in the Rakefile
15
15
  s.name = 'excon'
16
- s.version = '0.16.9'
16
+ s.version = '0.16.10'
17
17
  s.date = '2012-11-16'
18
18
  s.rubyforge_project = 'excon'
19
19
 
@@ -102,7 +102,7 @@ module Excon
102
102
  # push an additional stub onto the list to check for mock requests
103
103
  # @param [Hash<Symbol, >] request params to match against, omitted params match all
104
104
  # @param [Hash<Symbol, >] response params to return from matched request or block to call with params
105
- def stub(request_params, response_params = nil)
105
+ def stub(request_params = {}, response_params = nil)
106
106
  if url = request_params.delete(:url)
107
107
  uri = URI.parse(url)
108
108
  request_params.update(
@@ -29,7 +29,7 @@ module Excon
29
29
 
30
30
  REDACTED = 'REDACTED'
31
31
 
32
- VERSION = '0.16.9'
32
+ VERSION = '0.16.10'
33
33
 
34
34
  unless ::IO.const_defined?(:WaitReadable)
35
35
  class ::IO
@@ -21,6 +21,8 @@ module Excon
21
21
 
22
22
  class ProxyParseError < Error; end
23
23
 
24
+ class ProxyConnectionError < Error; end
25
+
24
26
  class StubNotFound < Error; end
25
27
 
26
28
  class HTTPStatusError < Error
@@ -31,7 +31,7 @@ module Excon
31
31
  end
32
32
  end
33
33
 
34
- unless (params[:method].to_s.casecmp('HEAD') == 0) || NO_ENTITY.include?(response.status)
34
+ unless (['HEAD', 'CONNECT'].include?(params[:method].to_s.upcase)) || NO_ENTITY.include?(response.status)
35
35
 
36
36
  # check to see if expects was set and matched
37
37
  expected_status = !params.has_key?(:expects) || [*params[:expects]].include?(response.status)
@@ -51,7 +51,7 @@ module Excon
51
51
  @socket.write(request)
52
52
 
53
53
  # eat the proxy's connection response
54
- Excon::Response.parse(@socket, {})
54
+ Excon::Response.parse(@socket, { :expects => 200, :method => "CONNECT" })
55
55
  end
56
56
 
57
57
  # convert Socket to OpenSSL::SSL::SSLSocket
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: excon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.9
4
+ version: 0.16.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -222,7 +222,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
222
222
  version: '0'
223
223
  segments:
224
224
  - 0
225
- hash: 2997528008362648241
225
+ hash: 4511517215737189818
226
226
  required_rubygems_version: !ruby/object:Gem::Requirement
227
227
  none: false
228
228
  requirements: