fingerprinter 0.1.3 → 0.1.5
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 +19 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f6821303bf8854c4b159cc1038bfb08af71d170b07a24e19376f49f88bba6ee
|
4
|
+
data.tar.gz: edd7faad955013acf5c94e897e4994e340baafc493c3f2c1bfccdb2bf7558f7c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 711d27cdd3329f07e6e24daa9400e36a8e8f62c6467870c0dc0309ed75bd1aa9713aaede490b9c882e91e1e69d8b9ccb0c20077f6e42a00353b03db685483078
|
7
|
+
data.tar.gz: 49b065930036587200a211e12337e67bd6a61643e0101c9e2ddb860bc5454542ce74fb33557a4ac830dfa27159410ea2317eee8f751ed49848265a8bc4834bb0
|
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:, doc:, url: }
|
48
48
|
Technologies.subclasses.each { |technology| results[url] << technology.run(data) }
|
49
49
|
end
|
50
50
|
end
|
@@ -59,11 +59,19 @@ module Fingerprinter
|
|
59
59
|
response = nil
|
60
60
|
3.times do
|
61
61
|
response = Fingerprinter.http_client.get(url, { follow_location: true })[url]
|
62
|
-
break if response&.code != 0
|
62
|
+
break if response&.code != 0 || timeout_without_scheme?(url, response)
|
63
63
|
|
64
64
|
sleep(1)
|
65
65
|
end
|
66
|
-
|
66
|
+
|
67
|
+
if stream_error?(response)
|
68
|
+
return
|
69
|
+
elsif timeout_without_scheme?(url, response)
|
70
|
+
url = "https://#{url}"
|
71
|
+
return get_response(url)
|
72
|
+
end
|
73
|
+
return if response&.code == 0
|
74
|
+
return response if same_scope?(url, response)
|
67
75
|
|
68
76
|
response.redirections.first
|
69
77
|
end
|
@@ -73,5 +81,13 @@ module Fingerprinter
|
|
73
81
|
|
74
82
|
Utilities::Urls.uri_parse(url)&.host == Utilities::Urls.uri_parse(response&.effective_url)&.host
|
75
83
|
end
|
84
|
+
|
85
|
+
def stream_error?(response)
|
86
|
+
response&.code&.zero? && response.return_message.include?('Stream error')
|
87
|
+
end
|
88
|
+
|
89
|
+
def timeout_without_scheme?(url, response)
|
90
|
+
response&.code == 0 && !url.start_with?('http') && response.return_message.include?('Timeout was reached')
|
91
|
+
end
|
76
92
|
end
|
77
93
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fingerprinter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joshua MARTINELLE
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-07-
|
11
|
+
date: 2024-07-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|