Skip to content

Commit

Permalink
Use existing key in fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
timacdonald committed Oct 16, 2024
1 parent 7dcd17c commit 40c0f6f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Illuminate/Cache/RateLimiting/Limit.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ public function response(callable $callback)
*/
public function fallbackKey()
{
return "attempts:{$this->maxAttempts}:decay:{$this->decaySeconds}";
$prefix = $this->key === '' ? '' : "{$this->key}:";

return "{$prefix}attempts:{$this->maxAttempts}:decay:{$this->decaySeconds}";
}
}

0 comments on commit 40c0f6f

Please sign in to comment.