excon 1.1.0 → 1.1.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: 8a1cbd57e645d8d22b4180e346b0fcf365165ffb9e95a69a83fe805f56d50e16
4
- data.tar.gz: e073309fd959dded213203af46f07bccded5fc8c1fe4b879902a9b04e5d82046
3
+ metadata.gz: 9cadb0fca5300321fa61bcdb57371355155c81328976a0f9e656e73b272e7b2c
4
+ data.tar.gz: 82fcc66b00fbda3159cab3153e8a084b68bf5c5fc193e5c2fb1b3eca511e8999
5
5
  SHA512:
6
- metadata.gz: 109ed16c1c5f49cc84261a0c271c0f8769aabc9258a1482842d1c2f48b96ff48ce558b7018b01a1054d57b0f15f4321430e6cfb5f2f8af354150b41dec976d24
7
- data.tar.gz: cb8c80990fea59470508ada7fcff74f217229c2f8f973d5369ef7f7beb32e105fb10013164427f787bcc38ff77f601fe617f0644a9a70407eaf405409444edfc
6
+ metadata.gz: 696637b0c1d203447e5b45ca73c7d5c97ed8dc2dea05c60873828b661c2d63f44a9c10b4970cc6ec79b9daa05abae603a5e015297c6c67046a8318c0768aa4e8
7
+ data.tar.gz: 62ec0190538e8ed8665e8f9bf95108d5acf9e3f6a4f7c71200dde2d6582c99fe444d9b6a2450c1f101d98ec784df4537fd677ed21744fd2d9c6d44b6fb5ef606
data/lib/excon/utils.rb CHANGED
@@ -69,21 +69,15 @@ 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 = {}
72
+ def split_query_string(string)
73
+ query = {}
75
74
 
76
75
  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
76
+ key, value = pair.split('=', 2)
77
+ query[key] = query[key] ? [query[key], value].flatten : value
84
78
  end
85
79
 
86
- params
80
+ query
87
81
  end
88
82
 
89
83
  def default_port?(datum)
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.1.1'
5
5
  end
data/lib/excon.rb CHANGED
@@ -163,7 +163,7 @@ module Excon
163
163
  request_params[:headers] = headers
164
164
  end
165
165
  if request_params.key?(:query) && request_params[:query].instance_of?(String)
166
- request_params[:query] = Utils.parse_query_string(request_params[:query])
166
+ request_params[:query] = Utils.split_query_string(request_params[:query])
167
167
  end
168
168
  if block_given?
169
169
  raise(ArgumentError, 'stub requires either response_params OR a block') if response_params
@@ -186,7 +186,7 @@ module Excon
186
186
  request_params[:method] = method.to_s.downcase.to_sym
187
187
  end
188
188
  if request_params.key?(:query) && request_params[:query].instance_of?(String)
189
- request_params[:query] = Utils.parse_query_string(request_params[:query])
189
+ request_params[:query] = Utils.split_query_string(request_params[:query])
190
190
  end
191
191
  Excon.stubs.each do |stub, response_params|
192
192
  captures = { headers: {} }
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.1.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-29 00:00:00.000000000 Z
13
+ date: 2024-10-30 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec