mirror of
https://github.com/flarum/core.git
synced 2025-08-18 06:11:23 +02:00
Introduce RequestUtil to encapsulate getting/setting actor on requests(#2449)
This commit is contained in:
committed by
GitHub
parent
da598db376
commit
94d69fe15f
@@ -26,7 +26,7 @@ class ThrottleApi implements ExtenderInterface
|
||||
*
|
||||
* The callable can be a closure or invokable class, and should accept:
|
||||
* - $request: The current `\Psr\Http\Message\ServerRequestInterface` request object.
|
||||
* `$request->getAttribute('actor')` can be used to get the current user.
|
||||
* `\Flarum\Http\RequestUtil::getActor($request)` can be used to get the current user.
|
||||
* `$request->getAttribute('routeName')` can be used to get the current route.
|
||||
* Please note that every throttler runs by default on every route.
|
||||
* If you only want to throttle certain routes, you'll need to check for that inside your logic.
|
||||
|
Reference in New Issue
Block a user