mirror of
https://github.com/nextcloud/server.git
synced 2026-06-03 13:58:55 -04:00
fix(dav): set user id header in response earlier
Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com>
This commit is contained in:
parent
c10f35333e
commit
0e944c190d
1 changed files with 2 additions and 2 deletions
|
|
@ -19,7 +19,7 @@ class UserIdHeaderPlugin extends \Sabre\DAV\ServerPlugin {
|
|||
}
|
||||
|
||||
public function initialize(\Sabre\DAV\Server $server): void {
|
||||
$server->on('afterMethod:*', [$this, 'afterMethod']);
|
||||
$server->on('beforeMethod:*', [$this, 'beforeMethod']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -28,7 +28,7 @@ class UserIdHeaderPlugin extends \Sabre\DAV\ServerPlugin {
|
|||
* @param RequestInterface $request request
|
||||
* @param ResponseInterface $response response
|
||||
*/
|
||||
public function afterMethod(RequestInterface $request, ResponseInterface $response): void {
|
||||
public function beforeMethod(RequestInterface $request, ResponseInterface $response): void {
|
||||
if ($user = $this->userSession->getUser()) {
|
||||
$response->setHeader('X-User-Id', $user->getUID());
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue