fingerprinter 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/fingerprinter.rb +10 -5
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a5d9551bfc1292f8beaa893f4d0aa76f43959f732149c5d2beb691088d5d8d4a
4
- data.tar.gz: f807abd267a54511288d860f3668500bbdec3bcb862b94f3b034324ee8f6bcb2
3
+ metadata.gz: 3b224d61b1b79fce378d1b8ad8ac84ac4f1de81cd37195281aee7e0051c684d6
4
+ data.tar.gz: df4ba4f706f8a5de13b778f050ee1568a5f9bdbf6cabaa7732ec5fcb745b0f39
5
5
  SHA512:
6
- metadata.gz: ed9bec0cbdbb74b0d29bc4cf8dcd6fdd7e086264f9db6f96cbe930d1460ff28f31c0494b5eedfdb926c48f0ec5c3b3b6c242fc1a23bfad8e74589057e9cfe98f
7
- data.tar.gz: 9d6c9096ffe5ea19f06d3271bca16c62a4d13648f771b8ca078b99015097e3e7837174adf91f5f7fd63e5afc0905289543d240110a9af2439ebc958109d815e1
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:, doc:, url: }
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 = Fingerprinter.http_client.get(url, { follow_location: true })[url]
60
- return if response&.code&.zero?
61
- return response if same_scope?(url, 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')
62
63
 
63
- Fingerprinter.http_client.get(url, { follow_location: false })[url]
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)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fingerprinter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua MARTINELLE