imgix 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/imgix/client.rb +1 -1
- data/lib/imgix/path.rb +5 -1
- data/lib/imgix/version.rb +1 -1
- data/test/units/path_test.rb +2 -2
- data/test/units/url_test.rb +1 -1
- 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: 69d79131db36ca98aed6917e44b11898b6004b73
|
4
|
+
data.tar.gz: dec4591b291abcd3d51fef005a14838e278580b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eddc85063053ebddcd2be6f76fec68cbe27d9290fed7d8d276563ebe798183191a55353fb3a313bafa44d45f51d18cd550953ebb70bc57f9e3d925dd9a2284f1
|
7
|
+
data.tar.gz: 4d1f7b5365986bf462024cacadb0caa5bcb2e01059aecab04ee0a2f947b8aebd383e416b7060067211f43ae2acef621dd90c90da5fb475691265885d4ed4cae7
|
data/lib/imgix/client.rb
CHANGED
@@ -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}
|
24
|
+
"#{@secure ? 'https' : 'http'}://#{@host}#{uri.path}?#{query}&s=#{signature}"
|
25
25
|
end
|
26
26
|
end
|
27
27
|
end
|
data/lib/imgix/path.rb
CHANGED
@@ -40,7 +40,11 @@ module Imgix
|
|
40
40
|
@options.merge!(opts)
|
41
41
|
|
42
42
|
url = @prefix + path_and_params
|
43
|
-
|
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
|
data/lib/imgix/version.rb
CHANGED
data/test/units/path_test.rb
CHANGED
@@ -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
|
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
|
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
|
data/test/units/url_test.rb
CHANGED
@@ -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
|
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.
|
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-
|
12
|
+
date: 2013-07-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: addressable
|