goldfinger 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/goldfinger/client.rb +5 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f66c83ee646aa481a6d414275702d9f82a04e328
|
4
|
+
data.tar.gz: 3c0cc3d24fdb392a2d6bcc49875476b83e8f246c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e03370097b2d600f6b141ef6039da82e6ccfe525e2f98003ed8f9fdbbf1b6562acca54146de5f0a1accadfb9346d7bbf8d9cb74de7b51a76e9a0ccd07db6678
|
7
|
+
data.tar.gz: 4f7f93dfa98ab42c1b3e85f0621eeb05bdf8434d4c21f2ab27e03d5cb8b07d4c12ffaab15a00984eb0ef59d51d97b9b29d06d992f48126e870fd06e607905407
|
data/lib/goldfinger/client.rb
CHANGED
@@ -13,7 +13,7 @@ module Goldfinger
|
|
13
13
|
ssl = true
|
14
14
|
|
15
15
|
begin
|
16
|
-
_, template
|
16
|
+
_, template = perform_get(url(ssl))
|
17
17
|
rescue HTTP::Error
|
18
18
|
if ssl
|
19
19
|
ssl = false
|
@@ -24,6 +24,9 @@ module Goldfinger
|
|
24
24
|
end
|
25
25
|
|
26
26
|
headers, body = perform_get(url_from_template(template))
|
27
|
+
|
28
|
+
raise Goldfinger::Error, "Invalid response mime type: #{headers.get(HTTP::Headers::CONTENT_TYPE).first}" unless ['application/jrd+json', 'application/xrd+xml'].include?(headers.get(HTTP::Headers::CONTENT_TYPE).first)
|
29
|
+
|
27
30
|
Goldfinger::Result.new(headers, body)
|
28
31
|
rescue HTTP::Error
|
29
32
|
raise Goldfinger::NotFoundError
|
@@ -43,8 +46,7 @@ module Goldfinger
|
|
43
46
|
|
44
47
|
raise Goldfinger::NotFoundError if links.empty?
|
45
48
|
|
46
|
-
|
47
|
-
url.expand({ uri: @uri }).to_s
|
49
|
+
links.first.attribute('template').value.gsub('{uri}', @uri)
|
48
50
|
end
|
49
51
|
|
50
52
|
def domain
|