excon 1.1.0 → 1.2.0

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: 8a1cbd57e645d8d22b4180e346b0fcf365165ffb9e95a69a83fe805f56d50e16
4
- data.tar.gz: e073309fd959dded213203af46f07bccded5fc8c1fe4b879902a9b04e5d82046
3
+ metadata.gz: 3a905930d349f68ec0851844a4107cd3e2e1b7cbf16283fa72bc8795db20c260
4
+ data.tar.gz: 1a5382bd4a2e03269d54272ecab5f90aac343f572be0b2c4dc27b567f8054402
5
5
  SHA512:
6
- metadata.gz: 109ed16c1c5f49cc84261a0c271c0f8769aabc9258a1482842d1c2f48b96ff48ce558b7018b01a1054d57b0f15f4321430e6cfb5f2f8af354150b41dec976d24
7
- data.tar.gz: cb8c80990fea59470508ada7fcff74f217229c2f8f973d5369ef7f7beb32e105fb10013164427f787bcc38ff77f601fe617f0644a9a70407eaf405409444edfc
6
+ metadata.gz: 9d76128a6817cb8cdfc77109b27ea7cbbb68ddc46d4335fa753711858e8c48db8eeca286ab0f1e1b3885d0b8aa589fe597a5559fa968e7f13e434abb33b05156
7
+ data.tar.gz: c89be296753470add2742bf9326ff27854968acfd152f9dfacdf2ff33e81a6c09491e32832ef9eb61dc7a23182d28fb5e1053a8e9b703bc3d3674414e408b958
@@ -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,23 +69,6 @@ module Excon
69
69
  end
70
70
  end
71
71
 
72
- # Used to normalize queries for stubs, based on Rack::Utils.parse_query
73
- def parse_query_string(string)
74
- params = {}
75
-
76
- string.split(/[&;] */n).each do |pair|
77
- key, value = pair.split('=', 2).map { |x| CGI.unescape(x) }
78
-
79
- params[key] = if params[key]
80
- [params[key], value].flatten
81
- else
82
- value
83
- end
84
- end
85
-
86
- params
87
- end
88
-
89
72
  def default_port?(datum)
90
73
  (!datum[:scheme]&.casecmp?('unix') && datum[:port].nil?) ||
91
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.0'
4
+ VERSION = '1.2.0'
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.parse_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.parse_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.0
4
+ version: 1.2.0
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-29 00:00:00.000000000 Z
13
+ date: 2024-11-07 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec