imgix 0.2.0 → 0.2.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: e7a5b61019c7034e4cab71bccb1506e50523b529
4
- data.tar.gz: 1fd4f9a95023c58150c616885344659b44d804b5
3
+ metadata.gz: 69d79131db36ca98aed6917e44b11898b6004b73
4
+ data.tar.gz: dec4591b291abcd3d51fef005a14838e278580b7
5
5
  SHA512:
6
- metadata.gz: e60eccc4c267a7cc96fde4b251c5156b30539b8be3a7397785138902e389efcb08b52e4542926895c83b2feeb5764dfa7e44d59917500306fafb01a1333ca83b
7
- data.tar.gz: 8fff63eb037dd4c223b2e4e6ec6e24c27a1cc398d7cc8bb79ebdb6b3249366b9d5bf7fa1464532e3cce5403bf1618117e88508839d19932f1300b5c9a8b5267f
6
+ metadata.gz: eddc85063053ebddcd2be6f76fec68cbe27d9290fed7d8d276563ebe798183191a55353fb3a313bafa44d45f51d18cd550953ebb70bc57f9e3d925dd9a2284f1
7
+ data.tar.gz: 4d1f7b5365986bf462024cacadb0caa5bcb2e01059aecab04ee0a2f947b8aebd383e416b7060067211f43ae2acef621dd90c90da5fb475691265885d4ed4cae7
@@ -21,7 +21,7 @@ module Imgix
21
21
  uri = Addressable::URI.parse(path)
22
22
  query = (uri.query || '')
23
23
  signature = Digest::MD5.hexdigest(@token + uri.path + '?' + query)
24
- "#{@secure ? 'https' : 'http'}://#{@host}#{uri.path}?#{query}#{query.length > 0 ? '&' : ''}s=#{signature}"
24
+ "#{@secure ? 'https' : 'http'}://#{@host}#{uri.path}?#{query}&s=#{signature}"
25
25
  end
26
26
  end
27
27
  end
@@ -40,7 +40,11 @@ module Imgix
40
40
  @options.merge!(opts)
41
41
 
42
42
  url = @prefix + path_and_params
43
- url += (@options.length > 0 ? '&' : '') + "s=#{signature}"
43
+
44
+ # Weird bug in imgix. If there are no params, you still have
45
+ # to put & in front of the signature or else you will get
46
+ # unauthorized.
47
+ url += "&s=#{signature}"
44
48
 
45
49
  @options = prev_options
46
50
  return url
@@ -1,3 +1,3 @@
1
1
  module Imgix
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.1'
3
3
  end
@@ -3,10 +3,10 @@ require 'test_helper'
3
3
  class UrlTest < Imgix::Test
4
4
  def test_creating_a_path
5
5
  path = client.path('/images/demo.png')
6
- assert_equal 'http://demo.imgix.net/images/demo.png?s=3c1d676d4daf28c044dd83e8548f834a', path.to_url
6
+ assert_equal 'http://demo.imgix.net/images/demo.png?&s=3c1d676d4daf28c044dd83e8548f834a', path.to_url
7
7
 
8
8
  path = client.path('images/demo.png')
9
- assert_equal 'http://demo.imgix.net/images/demo.png?s=3c1d676d4daf28c044dd83e8548f834a', path.to_url
9
+ assert_equal 'http://demo.imgix.net/images/demo.png?&s=3c1d676d4daf28c044dd83e8548f834a', path.to_url
10
10
  end
11
11
 
12
12
  def test_signing_path_with_param
@@ -3,7 +3,7 @@ require 'test_helper'
3
3
  class UrlTest < Imgix::Test
4
4
  def test_signing_with_no_params
5
5
  path = '/images/demo.png'
6
- assert_equal 'http://demo.imgix.net/images/demo.png?s=3c1d676d4daf28c044dd83e8548f834a', client.sign_path(path)
6
+ assert_equal 'http://demo.imgix.net/images/demo.png?&s=3c1d676d4daf28c044dd83e8548f834a', client.sign_path(path)
7
7
  end
8
8
 
9
9
  def test_signing_with_one
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: imgix
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Soffes
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-30 00:00:00.000000000 Z
12
+ date: 2013-07-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: addressable