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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: '08b40cc11bb3f226a66cc268ecc924e0c340880e'
4
- data.tar.gz: 73c74369eefec097816a367683a353a2c37fad19
3
+ metadata.gz: 255d54a6f0cad04486f09e887f8787725421fece
4
+ data.tar.gz: d1b74c09b4ef625e5fc4ef791dc896c792a79e19
5
5
  SHA512:
6
- metadata.gz: e6dd1403411ae60aac6f7380dea7c6788c6a605fe76b58177803d761eb1cd4282773d19e5ea6ca590ed67d93cf64ac03868880c0d90578d9550178a3daf3c53a
7
- data.tar.gz: aa62e154f5059e7baad7c4618e7e2c23097d34f259154b783052a42cfb77e22bba5d7012c65d6369bbb5511685f7461943adf209f2956ed45bac02c4ce1453c9
6
+ metadata.gz: 6ba5c551dec574810d6e2fe84b639660d7f6c36b2ee667bcf91cae9eb978567d0a076eaff3d80886c0d8b9f225c018561d28f51a09ebbe7102b62fcff17ec8f1
7
+ data.tar.gz: e5a1beb085744c890aff8cb42f238a1f2d5e041328d94cc2a5fafab75ca6f21385d4d4fa50a60c4033cedbcf611e10d4809c6337de2b98ce4a42fe32719773a4
@@ -1,3 +1,7 @@
1
+ ## 0.16.2
2
+
3
+ * [Support ActionDispatch::Http::UploadedFile again](https://github.com/jnunemaker/httparty/pull/585)
4
+
1
5
  ## 0.16.1
2
6
 
3
7
  * [Parse content with application/hal+json content type as JSON](https://github.com/jnunemaker/httparty/pull/573)
@@ -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
- memo += %(; filename="#{File.basename(value)}") if file?(value)
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"
@@ -1,3 +1,3 @@
1
1
  module HTTParty
2
- VERSION = "0.16.1"
2
+ VERSION = "0.16.2"
3
3
  end
@@ -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.1
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 00:00:00.000000000 Z
12
+ date: 2018-03-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: multi_xml