httparty 0.16.1 → 0.16.2
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/Changelog.md +4 -0
- data/lib/httparty/hash_conversions.rb +1 -1
- data/lib/httparty/request/body.rb +3 -1
- data/lib/httparty/version.rb +1 -1
- data/spec/httparty/hash_conversions_spec.rb +7 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 255d54a6f0cad04486f09e887f8787725421fece
|
4
|
+
data.tar.gz: d1b74c09b4ef625e5fc4ef791dc896c792a79e19
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ba5c551dec574810d6e2fe84b639660d7f6c36b2ee667bcf91cae9eb978567d0a076eaff3d80886c0d8b9f225c018561d28f51a09ebbe7102b62fcff17ec8f1
|
7
|
+
data.tar.gz: e5a1beb085744c890aff8cb42f238a1f2d5e041328d94cc2a5fafab75ca6f21385d4d4fa50a60c4033cedbcf611e10d4809c6337de2b98ce4a42fe32719773a4
|
data/Changelog.md
CHANGED
@@ -26,7 +26,7 @@ module HTTParty
|
|
26
26
|
def self.normalize_param(key, value)
|
27
27
|
normalized_keys = normalize_keys(key, value)
|
28
28
|
|
29
|
-
normalized_keys.inject('') do |string, (k, v)|
|
29
|
+
normalized_keys.flatten.each_slice(2).inject('') do |string, (k, v)|
|
30
30
|
string + "#{k}=#{ERB::Util.url_encode(v.to_s)}&"
|
31
31
|
end
|
32
32
|
end
|
@@ -32,7 +32,9 @@ module HTTParty
|
|
32
32
|
multipart = normalized_params.inject('') do |memo, (key, value)|
|
33
33
|
memo += "--#{boundary}\r\n"
|
34
34
|
memo += %(Content-Disposition: form-data; name="#{key}")
|
35
|
-
|
35
|
+
# value.path is used to support ActionDispatch::Http::UploadedFile
|
36
|
+
# https://github.com/jnunemaker/httparty/pull/585
|
37
|
+
memo += %(; filename="#{File.basename(value.path)}") if file?(value)
|
36
38
|
memo += "\r\n"
|
37
39
|
memo += "Content-Type: application/octet-stream\r\n" if file?(value)
|
38
40
|
memo += "\r\n"
|
data/lib/httparty/version.rb
CHANGED
@@ -11,6 +11,13 @@ RSpec.describe HTTParty::HashConversions do
|
|
11
11
|
}
|
12
12
|
expect(HTTParty::HashConversions.to_params(hash)).to eq("name=bob&address[street]=111%20ruby%20ave.&address[city]=ruby%20central&address[phones][]=111-111-1111&address[phones][]=222-222-2222")
|
13
13
|
end
|
14
|
+
|
15
|
+
context "nested params" do
|
16
|
+
it 'creates a params string from a hash' do
|
17
|
+
hash = { marketing_event: { marketed_resources: [ {type:"product", id: 57474842640 } ] } }
|
18
|
+
expect(HTTParty::HashConversions.to_params(hash)).to eq("marketing_event[marketed_resources][][type]=product&marketing_event[marketed_resources][][id]=57474842640")
|
19
|
+
end
|
20
|
+
end
|
14
21
|
end
|
15
22
|
|
16
23
|
describe ".normalize_param" do
|
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.16.
|
4
|
+
version: 0.16.2
|
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: 2018-03-
|
12
|
+
date: 2018-03-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: multi_xml
|