aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Server.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Server.php')
-rw-r--r--lib/private/Server.php15
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/private/Server.php b/lib/private/Server.php
index 00afaf1d6a9..b189905cfaf 100644
--- a/lib/private/Server.php
+++ b/lib/private/Server.php
@@ -60,6 +60,7 @@ use OC\App\AppStore\Fetcher\AppFetcher;
use OC\App\AppStore\Fetcher\CategoryFetcher;
use OC\AppFramework\Bootstrap\Coordinator;
use OC\AppFramework\Http\Request;
+use OC\AppFramework\Http\RequestId;
use OC\AppFramework\Utility\TimeFactory;
use OC\Authentication\Events\LoginFailed;
use OC\Authentication\Listeners\LoginFailedListener;
@@ -205,6 +206,7 @@ use OCP\ILogger;
use OCP\INavigationManager;
use OCP\IPreview;
use OCP\IRequest;
+use OCP\IRequestId;
use OCP\ISearch;
use OCP\IServerContainer;
use OCP\ISession;
@@ -1033,7 +1035,7 @@ class Server extends ServerContainer implements IServerContainer {
: '',
'urlParams' => $urlParams,
],
- $this->get(ISecureRandom::class),
+ $this->get(IRequestId::class),
$this->get(\OCP\IConfig::class),
$this->get(CsrfTokenManager::class),
$stream
@@ -1042,6 +1044,13 @@ class Server extends ServerContainer implements IServerContainer {
/** @deprecated 19.0.0 */
$this->registerDeprecatedAlias('Request', \OCP\IRequest::class);
+ $this->registerService(IRequestId::class, function (ContainerInterface $c): IRequestId {
+ return new RequestId(
+ $_SERVER['UNIQUE_ID'] ?? '',
+ $this->get(ISecureRandom::class)
+ );
+ });
+
$this->registerService(IMailer::class, function (Server $c) {
return new Mailer(
$c->get(\OCP\IConfig::class),
@@ -1214,7 +1223,7 @@ class Server extends ServerContainer implements IServerContainer {
$this->registerAlias(EventDispatcherInterface::class, \OC\EventDispatcher\SymfonyAdapter::class);
$this->registerService('CryptoWrapper', function (ContainerInterface $c) {
- // FIXME: Instantiiated here due to cyclic dependency
+ // FIXME: Instantiated here due to cyclic dependency
$request = new Request(
[
'get' => $_GET,
@@ -1227,7 +1236,7 @@ class Server extends ServerContainer implements IServerContainer {
? $_SERVER['REQUEST_METHOD']
: null,
],
- $c->get(ISecureRandom::class),
+ $c->get(IRequestId::class),
$c->get(\OCP\IConfig::class)
);