obf 0.9.8.14 → 0.9.8.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/obf/utils.rb +11 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b35bc7b687a61045d9eee1df5fd73118683ebfacd066f6d6c11776614fd4454
|
4
|
+
data.tar.gz: 477506945850cbcd78c9912167c8d35699f7977c25b25ab21c76227053b60bd6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac23a8a8b26c1f637c51b916224fb3c0bb4aa239f3709dbd4201800812e3fe6d981bff531bf207cfeb4e7e01ca36d862a71bdd06fda471d456cd97b4af17ff4d
|
7
|
+
data.tar.gz: aea19aceffda3756bf355ccf0928c08c8c642a6b57138ba41eb632bda4acf2e8fc2b9984018eda45c7470af1fe68d15b42e94ff5bfb7b6416c3a012912576e6b
|
data/lib/obf/utils.rb
CHANGED
@@ -14,21 +14,26 @@ module OBF::Utils
|
|
14
14
|
if hydra_wait
|
15
15
|
req = Typhoeus::Request.new(uri, followlocation: true)
|
16
16
|
req.on_complete do |response|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
17
|
+
if response.success?
|
18
|
+
res.delete('request')
|
19
|
+
res['content_type'] = response.headers['Content-Type']
|
20
|
+
res['data'] = response.body
|
21
|
+
res['extension'] = extension_for(res['content_type'])
|
22
|
+
else
|
23
|
+
OBF::Utils.log(" FAILED TO RETRIEVE #{uri.to_s} #{response.code}")
|
24
|
+
end
|
21
25
|
end
|
22
26
|
res['request'] = req
|
23
27
|
else
|
24
28
|
req = Typhoeus.get(uri, followlocation: true)
|
25
29
|
content_type = req.headers['Content-Type']
|
26
|
-
|
30
|
+
OBF::Utils.log(" FAILED TO RETRIEVE #{uri.to_s} #{req.code}") unless req.success?
|
31
|
+
data = req.body if req.success?
|
27
32
|
end
|
28
33
|
end
|
29
34
|
res['content_type'] = content_type
|
30
35
|
res['data'] = data
|
31
|
-
res['extension'] = extension_for(content_type)
|
36
|
+
res['extension'] = extension_for(content_type) if content_type
|
32
37
|
if res['request']
|
33
38
|
if hydra_wait
|
34
39
|
# do nothing
|