mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
Update Throttler docs [ci skip]
This commit is contained in:
parent
61c01ed40b
commit
906daf8a1d
@ -75,10 +75,9 @@ along the lines of::
|
||||
{
|
||||
$throttler = Services::throttler();
|
||||
|
||||
// Restrict an IP address to no more
|
||||
// than 1 request per second across the
|
||||
// entire site.
|
||||
if ($throttler->check($request->getIPAddress(), 60, MINUTE) === false) {
|
||||
// Restrict an IP address to no more than 1 request
|
||||
// per second across the entire site.
|
||||
if ($throttler->check(md5($request->getIPAddress()), 60, MINUTE) === false) {
|
||||
return Services::response()->setStatusCode(429);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user