Skip to content

Commit

Permalink
Merge pull request #13 from ItsANameToo/refactor/adjust-key-generation
Browse files Browse the repository at this point in the history
refactor: use sha1 for rate limit key generation
  • Loading branch information
danharrin authored Nov 25, 2022
2 parents b2c1260 + 89194ec commit 8abf691
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/WithRateLimiting.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ protected function getRateLimitKey($method)
{
if (! $method) $method = debug_backtrace()[1]['function'];

return static::class.'|'.$method.'|'.request()->ip();
return sha1(static::class.'|'.$method.'|'.request()->ip());
}

protected function hitRateLimiter($method = null, $decaySeconds = 60)
Expand Down

0 comments on commit 8abf691

Please sign in to comment.