aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public/AppFramework/Http/Response.php
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2022-01-31 15:01:58 +0100
committerRobin Appelman <robin@icewind.nl>2022-02-01 14:24:01 +0100
commitc7129878780787151eae9edeb680b11c45535a34 (patch)
tree09e119b47dde3f04790103a35b0b017fbab16efa /lib/public/AppFramework/Http/Response.php
parentd635d58d19d5ab65c0be754fc32fce99672c249f (diff)
downloadnextcloud-server-c7129878780787151eae9edeb680b11c45535a34.tar.gz
nextcloud-server-c7129878780787151eae9edeb680b11c45535a34.zip
send request id in response header
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/public/AppFramework/Http/Response.php')
-rw-r--r--lib/public/AppFramework/Http/Response.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/public/AppFramework/Http/Response.php b/lib/public/AppFramework/Http/Response.php
index ee10d483b25..ad2280ab9da 100644
--- a/lib/public/AppFramework/Http/Response.php
+++ b/lib/public/AppFramework/Http/Response.php
@@ -33,6 +33,7 @@ namespace OCP\AppFramework\Http;
use OCP\AppFramework\Http;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\IConfig;
+use OCP\IRequest;
use Psr\Log\LoggerInterface;
/**
@@ -94,6 +95,12 @@ class Response {
* @since 17.0.0
*/
public function __construct() {
+ /** @var IRequest $request */
+ /**
+ * @psalm-suppress UndefinedClass
+ */
+ $request = \OC::$server->get(IRequest::class);
+ $this->addHeader("X-Request-Id", $request->getId());
}
/**