vpndetection 5.22.0 → 5.22.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1c158a3f311984225a01173fe299a0d24a410e857ce63c1bbb0537aaaa97c7e6
4
- data.tar.gz: febea3b0b3665774985825d2012eefe3b1940f881c978e80d354c21c6d30878a
3
+ metadata.gz: 93b336a33a0b11e6b05b319a3a0acfa80a4db7e99fb26bc7c8b761ab0d854585
4
+ data.tar.gz: f563eaba0e2128d8a58a132bbb87f40de81d9ae15ee05cc69d39ed708ccd02fc
5
5
  SHA512:
6
- metadata.gz: 593d2fc397c7edb94ac7b8df2aae18adb462eb338d9f390139560635ff7e097a8b2a6009124e05cafdaa29c592dd0710b7e1038cc9bafdcf11b0a00eaa88b8f5
7
- data.tar.gz: 6cc95f71d88da71662ccd04ed0fb2cf10e46be2c069574d1432b1544d17ac5a280e09b05a34485ac21c4cd105432fd5ad105cf9d786d2f99e1cea021a541890d
6
+ metadata.gz: 727dd2f5e5c98b15752658ccf6d6cbd4062dade648d8031ebd333cf49adb21a7ca6a201bbcc98b2bc8f31c256addf6bec18d2b4f10c622e18578fb3f625d0461
7
+ data.tar.gz: acf92ab25d763f6abe8f993a118a97d503a2ea60cae040902efcd2c35267e2a736a331abb8c4897d1d37e097b6fc7a607143651558f8d5fdb1c77a5349d79630
@@ -157,7 +157,7 @@ module VPNDetection
157
157
  report_unanswered_agent(result) unless claim&.agent.nil?
158
158
  return Lookup.new(blocked: false, ip: ip, result: result) if @condition.nil?
159
159
 
160
- report_missing(result)
160
+ report_missing(result, sent: !claim&.agent.nil?)
161
161
  Lookup.new(
162
162
  blocked: Condition.matches?(@condition, result) && !verified?(result, claim),
163
163
  ip: ip,
@@ -175,13 +175,15 @@ module VPNDetection
175
175
  result.user_agent.is_a?(Hash) && result.user_agent['verdict'] == 'verified'
176
176
  end
177
177
 
178
- def report_missing(result)
178
+ def report_missing(result, sent:)
179
179
  return if @on_missing_field == :ignore
180
180
  # A bogon is answered locally in the widest shape, which carries every
181
181
  # member but `user_agent`, and no agent is sent for it.
182
182
  return if result.bogon?
183
183
 
184
184
  missing = Condition.missing_members(@condition, result)
185
+ # A request that sent no agent has no verdict to lack, whatever the plan serves.
186
+ missing -= ['user_agent'] if @allow_bots && !sent
185
187
  return if missing.empty?
186
188
 
187
189
  message = "block_condition names #{missing.join(', ')}, which your plan does not " \
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module VPNDetection
4
- VERSION = '5.22.0'
4
+ VERSION = '5.22.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vpndetection
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.22.0
4
+ version: 5.22.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mslm Dev