vzaar 1.6.0 → 1.6.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
  SHA1:
3
- metadata.gz: c1f51bc51dfb2661ea560ab755d5d259ecf5bc9a
4
- data.tar.gz: af11b53d12bd5a8e36e2ad787c0f14de5a7a1307
3
+ metadata.gz: 4d986a80dad0ab36749cc38b8316f006c788909e
4
+ data.tar.gz: 9ddee490c28424edff41e0147bea9e9a1d6a8756
5
5
  SHA512:
6
- metadata.gz: 7850014b6cd0aa53d6fe9ddfc94fb919a90ef738bb7f76d1936909a65f74e044a899a34261c5c9279322cd4fa0a5e91a679cbbee58ebe16c91b613f698a7236f
7
- data.tar.gz: faa4b22a4362cc33fa6a6e23d49cf969a40fa64ab9102aa1e17d734b4ef20bd17c34af63d01dee74744b2c59b138a46d4616ca7989016660b2d51e535cbd9bcc
6
+ metadata.gz: f6234fb2dff305773bcd961079fc85e29a731fdf13358c92a487070137dd87d51019d59416928a1ff3ddc23e18010f59469d31fdb49a4c22dec59a8062e2ddec
7
+ data.tar.gz: 7d0a77e07a21b27c36450b39c7a93e5b07b2ed6a5b5ffa39e25e6c8cad86abd9967ef021f7417b662c0d243275f262b653c56d7511828d58825b7c6085c8f947
data/ChangeLog CHANGED
@@ -1,4 +1,8 @@
1
- [1.6.0] 2015-07-07 EJ <ed@vzaar.com>
1
+ [1.6.1] 2016-04-21 EJ <ed@vzaar.com>
2
+
3
+ * escape ampersands in filename when sending signature request
4
+
5
+ [1.6.0] 2016-03-03 EJ <ed@vzaar.com>
2
6
 
3
7
  * support for chunked uploads
4
8
 
@@ -15,8 +15,8 @@ module Vzaar
15
15
  end
16
16
 
17
17
  def build_params
18
- _params = params ? (params.delete_if {|k,v| v.nil?}) : {}
19
- URI.escape(_params.collect { |k,v| "#{k}=#{v}" }.join('&'))
18
+ _params = params ? (params.delete_if { |k,v| v.nil? }) : {}
19
+ URI.encode_www_form(_params)
20
20
  end
21
21
 
22
22
  end
data/lib/vzaar/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Vzaar
2
- VERSION = "1.6.0"
2
+ VERSION = "1.6.1"
3
3
  end
@@ -2,24 +2,31 @@ require 'spec_helper'
2
2
  require './lib/vzaar/request/url'
3
3
 
4
4
  describe Vzaar::Request::Url do
5
- let(:params) do
6
- { foo: 1, bar: 2 }
7
- end
8
-
9
5
  let(:format) { :xml }
10
-
11
6
  let(:url) { "/api/endpoint" }
12
7
 
13
8
  subject { described_class.new(url, format, params) }
14
9
 
15
10
  describe "#build" do
11
+ let(:result) { subject.build }
12
+
16
13
  context "when there are params" do
17
- specify { expect(subject.build).to eq("/api/endpoint.xml?foo=1&bar=2") }
14
+ let(:params) { { foo: 1, bar: 2 } }
15
+ let(:expected_result) { "/api/endpoint.xml?foo=1&bar=2" }
16
+ specify { expect(result).to eq expected_result }
17
+
18
+ context 'and the params contain an unescaped ampersand' do
19
+ let(:params) { { foo: 'this & that.mp4', bar: 2 } }
20
+ let(:encoded_params) { URI.encode_www_form params }
21
+ let(:expected_result) { "/api/endpoint.xml?#{encoded_params}" }
22
+ specify { expect(result).to eq expected_result }
23
+ end
18
24
  end
19
25
 
20
26
  context "when there are params" do
21
27
  let(:params) {{}}
22
- specify { expect(subject.build).to eq("/api/endpoint.xml") }
28
+ let(:expected_result) { "/api/endpoint.xml" }
29
+ specify { expect(result).to eq expected_result }
23
30
  end
24
31
  end
25
32
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vzaar
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ed James
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-03-03 00:00:00.000000000 Z
12
+ date: 2016-04-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
@@ -319,7 +319,7 @@ rubyforge_project:
319
319
  rubygems_version: 2.5.1
320
320
  signing_key:
321
321
  specification_version: 4
322
- summary: vzaar-1.6.0
322
+ summary: vzaar-1.6.1
323
323
  test_files:
324
324
  - spec/fixtures/vcr_cassettes/account_type-fail.yml
325
325
  - spec/fixtures/vcr_cassettes/account_type-success.yml