Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
feat: add header with user id in response
Signed-off-by: Robin Appelman <[email protected]>
  • Loading branch information
icewind1991 committed Oct 7, 2025
commit 4ab388ef08eba96187c9fbd901da77aa37de4cfe
6 changes: 6 additions & 0 deletions lib/public/AppFramework/Http/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\IConfig;
use OCP\IRequest;
use OCP\IUserSession;
use Psr\Log\LoggerInterface;

/**
Expand Down Expand Up @@ -246,6 +247,11 @@ public function getHeaders() {
$mergeWith['ETag'] = '"' . $this->ETag . '"';
}

$userSession = \OC::$server->get(IUserSession::class);
if ($user = $userSession->getUser()) {
$mergeWith['X-User-Id'] = $user->getUID();
}

return array_merge($mergeWith, $this->headers);
}

Expand Down
Loading