fingerprinter 0.1.2 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fingerprinter.rb +8 -2
- 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: e23aed5ef3ed13d6d87ce5c9a60f8ae7c76b1af3072e5743e2d2fe97613c69a0
|
4
|
+
data.tar.gz: 5fdd5658a3eef4660f3c7274065e409b47e602c4a3f213c90de0bc002f052688
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80134337a1020a483c849b4e54944531cf414a47325e8b51365f95bfebaaac8beab2b9b8e963f76a05a6cc218b57fb7c45756cfdf54bf6bba616919e7f2bab46
|
7
|
+
data.tar.gz: a4d1599414026b37d11628e6c84abba00c071c05857ee4ca9b833149fe3f8a81a384f6d4b0fe10f36833b8bbd0d0dfd7afd21566ca177476c71865dd5a38902b
|
data/lib/fingerprinter.rb
CHANGED
@@ -56,11 +56,17 @@ module Fingerprinter
|
|
56
56
|
private
|
57
57
|
|
58
58
|
def get_response(url)
|
59
|
-
response =
|
59
|
+
response = nil
|
60
|
+
3.times do
|
61
|
+
response = Fingerprinter.http_client.get(url, { follow_location: true })[url]
|
62
|
+
break if response&.code != 0 && !response.return_message.include?('Stream error')
|
63
|
+
|
64
|
+
sleep(1)
|
65
|
+
end
|
60
66
|
return if response&.code&.zero?
|
61
67
|
return response if same_scope?(url, response)
|
62
68
|
|
63
|
-
|
69
|
+
response.redirections.first
|
64
70
|
end
|
65
71
|
|
66
72
|
def same_scope?(url, response)
|