fingerprinter 0.1.2 → 0.1.3
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 +10 -5
- 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: 3b224d61b1b79fce378d1b8ad8ac84ac4f1de81cd37195281aee7e0051c684d6
|
4
|
+
data.tar.gz: df4ba4f706f8a5de13b778f050ee1568a5f9bdbf6cabaa7732ec5fcb745b0f39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc74aa0e8bf750f3a9d8a727a958e23d3a285491c0501763238cd5493e865bebe9590c42090b7bbf1f1cdea2ba9ac56824784eb3079b7fafeb9923deed1eae07
|
7
|
+
data.tar.gz: 7e70c7c5e3fabafd2c73dd53a1a41b1a05769044978005f0a521646b30a78ba5bc1b3a701ccd9d0b05a2cd5d6266fa35bf5075bf7f908f6babe0ff2ada89541f
|
data/lib/fingerprinter.rb
CHANGED
@@ -44,7 +44,7 @@ module Fingerprinter
|
|
44
44
|
doc = Utilities::Parser.doc(response.body)
|
45
45
|
|
46
46
|
results[url] = Concurrent::Array.new
|
47
|
-
data = { response
|
47
|
+
data = { response: response, doc: doc, url: url }
|
48
48
|
Technologies.subclasses.each { |technology| results[url] << technology.run(data) }
|
49
49
|
end
|
50
50
|
end
|
@@ -56,11 +56,16 @@ module Fingerprinter
|
|
56
56
|
private
|
57
57
|
|
58
58
|
def get_response(url)
|
59
|
-
response =
|
60
|
-
|
61
|
-
|
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')
|
62
63
|
|
63
|
-
|
64
|
+
sleep(1)
|
65
|
+
end
|
66
|
+
return response if response&.code&.zero? || same_scope?(url, response)
|
67
|
+
|
68
|
+
response.redirections.first
|
64
69
|
end
|
65
70
|
|
66
71
|
def same_scope?(url, response)
|