fingerprinter 0.1.2 → 0.1.4

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 +8 -2
  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: e23aed5ef3ed13d6d87ce5c9a60f8ae7c76b1af3072e5743e2d2fe97613c69a0
4
+ data.tar.gz: 5fdd5658a3eef4660f3c7274065e409b47e602c4a3f213c90de0bc002f052688
5
5
  SHA512:
6
- metadata.gz: ed9bec0cbdbb74b0d29bc4cf8dcd6fdd7e086264f9db6f96cbe930d1460ff28f31c0494b5eedfdb926c48f0ec5c3b3b6c242fc1a23bfad8e74589057e9cfe98f
7
- data.tar.gz: 9d6c9096ffe5ea19f06d3271bca16c62a4d13648f771b8ca078b99015097e3e7837174adf91f5f7fd63e5afc0905289543d240110a9af2439ebc958109d815e1
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 = Fingerprinter.http_client.get(url, { follow_location: true })[url]
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
- Fingerprinter.http_client.get(url, { follow_location: false })[url]
69
+ response.redirections.first
64
70
  end
65
71
 
66
72
  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.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua MARTINELLE