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 +4 -4
- data/lib/vpndetection/middleware/core.rb +4 -2
- data/lib/vpndetection/version.rb +1 -1
- 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: 93b336a33a0b11e6b05b319a3a0acfa80a4db7e99fb26bc7c8b761ab0d854585
|
|
4
|
+
data.tar.gz: f563eaba0e2128d8a58a132bbb87f40de81d9ae15ee05cc69d39ed708ccd02fc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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 " \
|
data/lib/vpndetection/version.rb
CHANGED