httparty 0.19.0 → 0.20.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of httparty might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +8 -13
- data/Changelog.md +15 -0
- data/README.md +1 -1
- data/httparty.gemspec +1 -1
- data/lib/httparty/connection_adapter.rb +1 -1
- data/lib/httparty/hash_conversions.rb +1 -1
- data/lib/httparty/request/body.rb +1 -1
- data/lib/httparty/request.rb +12 -0
- data/lib/httparty/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bde34a85d8b010341759c1b2b42dfe58cad693c39f047b9803ac90afbc13290b
|
4
|
+
data.tar.gz: b5248420c90ea545dfa9e6e234d6c597b4c7306dfc8d58ff94dca82e405e0ed1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13316910a85a75d1204c64be41e995475b26abf9aad1165c06349c296d0b3f0f6ae644b00d8bcf14adc3d9a11659bffd060a5101dc88718af74d0324adde9e30
|
7
|
+
data.tar.gz: 668fac0ca6a513e64dead9b633ecb12c4ff926cb017e4e7e244249cfb361f93e1aa515ef3fb6b80e6245264e7da38d0599abec9931c5b33b88d7235b966b0aa1
|
data/.github/workflows/ci.yml
CHANGED
@@ -5,24 +5,19 @@ jobs:
|
|
5
5
|
runs-on: ubuntu-latest
|
6
6
|
strategy:
|
7
7
|
matrix:
|
8
|
-
ruby:
|
8
|
+
ruby:
|
9
|
+
- 2.3
|
10
|
+
- 2.4
|
11
|
+
- 2.5
|
12
|
+
- 2.6
|
13
|
+
- 2.7
|
9
14
|
steps:
|
10
15
|
- name: Check out repository code
|
11
16
|
uses: actions/checkout@v2
|
12
|
-
- name: Do some action caching
|
13
|
-
uses: actions/cache@v1
|
14
|
-
with:
|
15
|
-
path: vendor/bundle
|
16
|
-
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
|
17
|
-
restore-keys: |
|
18
|
-
${{ runner.os }}-gem-
|
19
17
|
- name: Set up Ruby
|
20
|
-
uses:
|
18
|
+
uses: ruby/setup-ruby@v1
|
21
19
|
with:
|
22
20
|
ruby-version: ${{ matrix.ruby }}
|
23
|
-
|
24
|
-
run: gem install bundler
|
25
|
-
- name: Run bundler
|
26
|
-
run: bundle install --jobs 4 --retry 3
|
21
|
+
bundler-cache: true # Run "bundle install", and cache the result automatically.
|
27
22
|
- name: Run Rake
|
28
23
|
run: bundle exec rake
|
data/Changelog.md
CHANGED
@@ -1,3 +1,18 @@
|
|
1
|
+
## 0.20.0
|
2
|
+
|
3
|
+
Breaking changes
|
4
|
+
|
5
|
+
* Require Ruby >= 2.3.0
|
6
|
+
|
7
|
+
Fixes
|
8
|
+
|
9
|
+
* [`Marshal.dump` fails on response objects when request option `:logger` is set or `:parser` is a proc](https://github.com/jnunemaker/httparty/pull/714)
|
10
|
+
* [Switch `:pem` option to to `OpenSSL::PKey.read` to support other algorithms](https://github.com/jnunemaker/httparty/pull/720)
|
11
|
+
|
12
|
+
## 0.19.1
|
13
|
+
|
14
|
+
* [Remove use of unary + method for creating non-frozen string to increase compatibility with older versions of ruby](https://github.com/jnunemaker/httparty/commit/4416141d37fd71bdba4f37589ec265f55aa446ce)
|
15
|
+
|
1
16
|
## 0.19.0
|
2
17
|
|
3
18
|
* [Multipart/Form-Data: rewind files after read](https://github.com/jnunemaker/httparty/pull/709)
|
data/README.md
CHANGED
data/httparty.gemspec
CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
|
|
13
13
|
s.summary = 'Makes http fun! Also, makes consuming restful web services dead easy.'
|
14
14
|
s.description = 'Makes http fun! Also, makes consuming restful web services dead easy.'
|
15
15
|
|
16
|
-
s.required_ruby_version = '>= 2.
|
16
|
+
s.required_ruby_version = '>= 2.3.0'
|
17
17
|
|
18
18
|
s.add_dependency 'multi_xml', ">= 0.5.2"
|
19
19
|
s.add_dependency('mime-types', "~> 3.0")
|
@@ -223,7 +223,7 @@ module HTTParty
|
|
223
223
|
# Note: options[:pem] must contain the content of a PEM file having the private key appended
|
224
224
|
if options[:pem]
|
225
225
|
http.cert = OpenSSL::X509::Certificate.new(options[:pem])
|
226
|
-
http.key = OpenSSL::PKey
|
226
|
+
http.key = OpenSSL::PKey.read(options[:pem], options[:pem_password])
|
227
227
|
http.verify_mode = verify_ssl_certificate? ? OpenSSL::SSL::VERIFY_PEER : OpenSSL::SSL::VERIFY_NONE
|
228
228
|
end
|
229
229
|
|
@@ -28,7 +28,7 @@ module HTTParty
|
|
28
28
|
def self.normalize_param(key, value)
|
29
29
|
normalized_keys = normalize_keys(key, value)
|
30
30
|
|
31
|
-
normalized_keys.flatten.each_slice(2).inject(
|
31
|
+
normalized_keys.flatten.each_slice(2).inject(''.dup) do |string, (k, v)|
|
32
32
|
string << "#{ERB::Util.url_encode(k)}=#{ERB::Util.url_encode(v.to_s)}&"
|
33
33
|
end
|
34
34
|
end
|
@@ -35,7 +35,7 @@ module HTTParty
|
|
35
35
|
def generate_multipart
|
36
36
|
normalized_params = params.flat_map { |key, value| HashConversions.normalize_keys(key, value) }
|
37
37
|
|
38
|
-
multipart = normalized_params.inject(
|
38
|
+
multipart = normalized_params.inject(''.dup) do |memo, (key, value)|
|
39
39
|
memo << "--#{boundary}#{NEWLINE}"
|
40
40
|
memo << %(Content-Disposition: form-data; name="#{key}")
|
41
41
|
# value.path is used to support ActionDispatch::Http::UploadedFile
|
data/lib/httparty/request.rb
CHANGED
@@ -46,6 +46,11 @@ module HTTParty
|
|
46
46
|
end.flatten.join('&')
|
47
47
|
end
|
48
48
|
|
49
|
+
def self._load(data)
|
50
|
+
http_method, path, options = Marshal.load(data)
|
51
|
+
new(http_method, path, options)
|
52
|
+
end
|
53
|
+
|
49
54
|
attr_accessor :http_method, :options, :last_response, :redirect, :last_uri
|
50
55
|
attr_reader :path
|
51
56
|
|
@@ -175,6 +180,13 @@ module HTTParty
|
|
175
180
|
@raw_request.body
|
176
181
|
end
|
177
182
|
|
183
|
+
def _dump(_level)
|
184
|
+
opts = options.dup
|
185
|
+
opts.delete(:logger)
|
186
|
+
opts.delete(:parser) if opts[:parser] && opts[:parser].is_a?(Proc)
|
187
|
+
Marshal.dump([http_method, path, opts])
|
188
|
+
end
|
189
|
+
|
178
190
|
private
|
179
191
|
|
180
192
|
def http
|
data/lib/httparty/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: httparty
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.20.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Nunemaker
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-09-
|
12
|
+
date: 2021-09-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: multi_xml
|
@@ -124,7 +124,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
124
124
|
requirements:
|
125
125
|
- - ">="
|
126
126
|
- !ruby/object:Gem::Version
|
127
|
-
version: 2.
|
127
|
+
version: 2.3.0
|
128
128
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
129
129
|
requirements:
|
130
130
|
- - ">="
|