Skip to content

Commit 8ca457d

Browse files
authored
Merge pull request #66 from Carnicero90/attempts-count-issue-fixing
addressing attempts count issue
2 parents 0509810 + 705707b commit 8ca457d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Listeners/BlockIp.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ public function handle(AttackDetected $event)
2222
$start = $end->copy()->subSeconds(config('firewall.middleware.' . $event->log->middleware . '.auto_block.frequency'));
2323

2424
$log = config('firewall.models.log', Log::class);
25-
$count = $log::where('ip', $event->log->ip)->whereBetween('created_at', [$start, $end])->count();
25+
$count = $log::where('ip', $event->log->ip)
26+
->where('middleware', $event->log->middleware)
27+
->whereBetween('created_at', [$start, $end])->count();
2628

2729
if ($count != config('firewall.middleware.' . $event->log->middleware . '.auto_block.attempts')) {
2830
return;

0 commit comments

Comments
 (0)