]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Xrd.php
Changes:
[friendica.git] / src / Module / Xrd.php
index 6a4c0e860d31be4c12b07e005074a705d3647ba8..8e314400186269c2ac1c9e73f4bd3d9ff71e4ade 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2023, the Friendica project
+ * @copyright Copyright (C) 2010-2024, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -38,6 +38,8 @@ class Xrd extends BaseModule
 {
        protected function rawContent(array $request = [])
        {
+               header('Vary: Accept', false);
+
                // @TODO: Replace with parameter from router
                if (DI::args()->getArgv()[0] == 'xrd') {
                        if (empty($_GET['uri'])) {
@@ -80,6 +82,8 @@ class Xrd extends BaseModule
                        throw new NotFoundException('Invalid host name for xrd query: ' . $host);
                }
 
+               header('Vary: Accept', false);
+
                if ($name == User::getActorName()) {
                        $owner = User::getSystemAccount();
                        if (empty($owner)) {
@@ -152,7 +156,7 @@ class Xrd extends BaseModule
                        ]
                ];
                header('Access-Control-Allow-Origin: *');
-               System::jsonExit($json, 'application/jrd+json; charset=utf-8');
+               $this->jsonExit($json, 'application/jrd+json; charset=utf-8');
        }
 
        private function printJSON(string $alias, array $owner, array $avatar)
@@ -229,7 +233,7 @@ class Xrd extends BaseModule
                ];
 
                header('Access-Control-Allow-Origin: *');
-               System::jsonExit($json, 'application/jrd+json; charset=utf-8');
+               $this->jsonExit($json, 'application/jrd+json; charset=utf-8');
        }
 
        private function printXML(string $alias, array $owner, array $avatar)
@@ -326,7 +330,6 @@ class Xrd extends BaseModule
                ]);
 
                header('Access-Control-Allow-Origin: *');
-
-               System::httpExit($xmlString, Response::TYPE_XML, 'application/xrd+xml');
+               $this->httpExit($xmlString, Response::TYPE_XML, 'application/xrd+xml');
        }
 }