]> git.mxchange.org Git - friendica.git/commitdiff
Allow CORS requests to nodeinfo endpoints
authorWladimir Palant <fqcgithub@palant.de>
Mon, 16 Oct 2023 20:05:58 +0000 (22:05 +0200)
committerHypolite Petovan <hypolite@mrpetovan.com>
Tue, 17 Oct 2023 00:10:36 +0000 (20:10 -0400)
src/BaseModule.php

index 1cdf96dff69421ed5e930012215b4068f3a74e24..dc7aaedd90b5e550c464e05d8e5c848fa66ce138 100644 (file)
@@ -190,6 +190,11 @@ abstract class BaseModule implements ICanHandleRequests
                        $this->response->setHeader('*', 'Access-Control-Allow-Headers');
                        $this->response->setHeader(Router::GET, 'Access-Control-Allow-Methods');
                        $this->response->setHeader('false', 'Access-Control-Allow-Credentials');
+               } elseif (substr($this->args->getQueryString(), 0, 9) == 'nodeinfo/') {
+                       $this->response->setHeader('*', 'Access-Control-Allow-Origin');
+                       $this->response->setHeader('*', 'Access-Control-Allow-Headers');
+                       $this->response->setHeader(Router::GET, 'Access-Control-Allow-Methods');
+                       $this->response->setHeader('false', 'Access-Control-Allow-Credentials');
                } elseif (substr($this->args->getQueryString(), 0, 8) == 'profile/') {
                        $this->response->setHeader('*', 'Access-Control-Allow-Origin');
                        $this->response->setHeader('*', 'Access-Control-Allow-Headers');