We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1728d02 commit b2a17b4Copy full SHA for b2a17b4
lib/public/AppFramework/Http/Response.php
@@ -11,6 +11,8 @@
11
use OCP\AppFramework\Utility\ITimeFactory;
12
use OCP\IConfig;
13
use OCP\IRequest;
14
+use OCP\IUserSession;
15
+use OCP\Server;
16
use Psr\Log\LoggerInterface;
17
18
/**
@@ -246,6 +248,11 @@ public function getHeaders() {
246
248
$mergeWith['ETag'] = '"' . $this->ETag . '"';
247
249
}
250
251
+ $userSession = Server::get(IUserSession::class);
252
+ if ($user = $userSession->getUser()) {
253
+ $mergeWith['X-User-Id'] = $user->getUID();
254
+ }
255
+
256
return array_merge($mergeWith, $this->headers);
257
258
0 commit comments