excon 1.1.1 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9cadb0fca5300321fa61bcdb57371355155c81328976a0f9e656e73b272e7b2c
4
- data.tar.gz: 82fcc66b00fbda3159cab3153e8a084b68bf5c5fc193e5c2fb1b3eca511e8999
3
+ metadata.gz: 738c867acaec7b89bbee08c77558f9c38edf9c0531b5c3d003981418e12a1553
4
+ data.tar.gz: 87357f9d74d762d2e48c1af4341865588e9438fd989a91e8c83c9ec85e34cddb
5
5
  SHA512:
6
- metadata.gz: 696637b0c1d203447e5b45ca73c7d5c97ed8dc2dea05c60873828b661c2d63f44a9c10b4970cc6ec79b9daa05abae603a5e015297c6c67046a8318c0768aa4e8
7
- data.tar.gz: 62ec0190538e8ed8665e8f9bf95108d5acf9e3f6a4f7c71200dde2d6582c99fe444d9b6a2450c1f101d98ec784df4537fd677ed21744fd2d9c6d44b6fb5ef606
6
+ metadata.gz: a33ee1422f54944d24b554a5a6c6dccecbbabcf92ceecc3ecf5fada7da39aa2b3e4edbea1d55c1acc17642c0c83d34ee2e0effaff5be6a65d24b02e2694c8ff9
7
+ data.tar.gz: a5ce6c300dc830e85e34e8551f07236135f33964e189cc50408bc1b1b68e0d6fa3ecadaa13daa8aa55f350b26ebb8425affb6392610d12911cbe89053e2f0620
@@ -194,7 +194,7 @@ module Excon
194
194
  raise(error)
195
195
  when Errno::EPIPE
196
196
  # Read whatever remains in the pipe to aid in debugging
197
- response = socket.read
197
+ response = socket.read rescue ""
198
198
  error = Excon::Error.new(response + error.message)
199
199
  raise_socket_error(error)
200
200
  else
@@ -108,7 +108,7 @@ module Excon
108
108
  end
109
109
 
110
110
  if @data[:proxy]
111
- request = "CONNECT #{@data[:host]}#{Excon::HTTP_1_1}" \
111
+ request = "CONNECT #{@data[:host]}#{port_string(@data)}#{Excon::HTTP_1_1}" \
112
112
  "Host: #{@data[:host]}#{port_string(@data)}#{Excon::CR_NL}"
113
113
 
114
114
  if @data[:proxy].has_key?(:user) || @data[:proxy].has_key?(:password)
data/lib/excon/utils.rb CHANGED
@@ -69,17 +69,6 @@ module Excon
69
69
  end
70
70
  end
71
71
 
72
- def split_query_string(string)
73
- query = {}
74
-
75
- string.split(/[&;] */n).each do |pair|
76
- key, value = pair.split('=', 2)
77
- query[key] = query[key] ? [query[key], value].flatten : value
78
- end
79
-
80
- query
81
- end
82
-
83
72
  def default_port?(datum)
84
73
  (!datum[:scheme]&.casecmp?('unix') && datum[:port].nil?) ||
85
74
  (datum[:scheme]&.casecmp?('http') && datum[:port] == 80) ||
data/lib/excon/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Excon
4
- VERSION = '1.1.1'
4
+ VERSION = '1.2.1'
5
5
  end
data/lib/excon.rb CHANGED
@@ -162,9 +162,7 @@ module Excon
162
162
  end
163
163
  request_params[:headers] = headers
164
164
  end
165
- if request_params.key?(:query) && request_params[:query].instance_of?(String)
166
- request_params[:query] = Utils.split_query_string(request_params[:query])
167
- end
165
+ request_params[:query] = Utils.query_string(request_params)[1...] if request_params.key?(:query)
168
166
  if block_given?
169
167
  raise(ArgumentError, 'stub requires either response_params OR a block') if response_params
170
168
 
@@ -185,9 +183,7 @@ module Excon
185
183
  if (method = request_params.delete(:method))
186
184
  request_params[:method] = method.to_s.downcase.to_sym
187
185
  end
188
- if request_params.key?(:query) && request_params[:query].instance_of?(String)
189
- request_params[:query] = Utils.split_query_string(request_params[:query])
190
- end
186
+ request_params[:query] = Utils.query_string(request_params)[1...] if request_params.key?(:query)
191
187
  Excon.stubs.each do |stub, response_params|
192
188
  captures = { headers: {} }
193
189
  headers_match = !stub.key?(:headers) || stub[:headers].keys.all? do |key|
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: 1.1.1
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - dpiddy (Dan Peterson)
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2024-10-30 00:00:00.000000000 Z
13
+ date: 2024-11-14 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec