From: Michael Date: Sun, 8 Jan 2023 09:41:54 +0000 (+0000) Subject: OStatus: Fix PubSubHubBub subscription X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c3d836db631b002108789238f45478e9245bfb16;p=friendica.git OStatus: Fix PubSubHubBub subscription --- diff --git a/src/Module/OStatus/PubSub.php b/src/Module/OStatus/PubSub.php index c83ac4986b..c4614855ca 100644 --- a/src/Module/OStatus/PubSub.php +++ b/src/Module/OStatus/PubSub.php @@ -58,6 +58,7 @@ class PubSub extends \Friendica\BaseModule $this->logger->info('Feed arrived.', ['from' => $this->request->getRemoteAddress(), 'for' => $this->args->getCommand(), 'user-agent' => $this->server['HTTP_USER_AGENT']]); $this->logger->debug('Data stream.', ['xml' => $xml]); + $this->logger->debug('Gut request data.', ['request' => $request]); $nickname = $this->parameters['nickname'] ?? ''; $contact_id = $this->parameters['cid'] ?? 0; diff --git a/src/Module/OStatus/PubSubHubBub.php b/src/Module/OStatus/PubSubHubBub.php index edc2472f48..de2104b212 100644 --- a/src/Module/OStatus/PubSubHubBub.php +++ b/src/Module/OStatus/PubSubHubBub.php @@ -71,6 +71,8 @@ class PubSubHubBub extends \Friendica\BaseModule throw new HTTPException\ForbiddenException(); } + $this->logger->debug('Gut request data.', ['request' => $request]); + // Subscription request from subscriber // https://pubsubhubbub.github.io/PubSubHubbub/pubsubhubbub-core-0.4.html#rfc.section.5.1 // Example from GNU Social: diff --git a/src/Module/OStatus/Salmon.php b/src/Module/OStatus/Salmon.php index 0fd901eaf4..64dcec22cf 100644 --- a/src/Module/OStatus/Salmon.php +++ b/src/Module/OStatus/Salmon.php @@ -62,9 +62,10 @@ class Salmon extends \Friendica\BaseModule * @throws HTTPException\OKException * @throws \ImagickException */ - protected function rawContent(array $request = []) + protected function post(array $request = []) { $xml = Network::postdata(); + $this->logger->debug('Gut request data.', ['request' => $request]); $nickname = $this->parameters['nickname'] ?? ''; if (empty($nickname)) { diff --git a/static/routes.config.php b/static/routes.config.php index 1c6268aa95..634b90b23a 100644 --- a/static/routes.config.php +++ b/static/routes.config.php @@ -598,12 +598,13 @@ return [ ], // OStatus stack modules - '/ostatus/repair' => [Module\OStatus\Repair::class, [R::GET ]], - '/ostatus/subscribe' => [Module\OStatus\Subscribe::class, [R::GET ]], - '/poco' => [Module\User\PortableContacts::class, [R::GET ]], - '/pubsub/{nickname}/{cid:\d+}' => [Module\OStatus\PubSub::class, [R::GET, R::POST]], - '/pubsubhubbub/{nickname}' => [Module\OStatus\PubSubHubBub::class, [ R::POST]], - '/salmon/{nickname}' => [Module\OStatus\Salmon::class, [ R::POST]], + '/ostatus/repair' => [Module\OStatus\Repair::class, [R::GET ]], + '/ostatus/subscribe' => [Module\OStatus\Subscribe::class, [R::GET ]], + '/poco' => [Module\User\PortableContacts::class, [R::GET ]], + '/pubsub' => [Module\OStatus\PubSub::class, [R::GET, R::POST]], + '/pubsub/{nickname}[/{cid:\d+}]' => [Module\OStatus\PubSub::class, [R::GET, R::POST]], + '/pubsubhubbub[/{nickname}]' => [Module\OStatus\PubSubHubBub::class, [ R::POST]], + '/salmon[/{nickname}]' => [Module\OStatus\Salmon::class, [ R::POST]], '/search' => [ '[/]' => [Module\Search\Index::class, [R::GET ]],