diff --git a/src/Service/DeliverManager.php b/src/Service/DeliverManager.php index c79f5c485..7621d0c67 100644 --- a/src/Service/DeliverManager.php +++ b/src/Service/DeliverManager.php @@ -6,6 +6,7 @@ use App\Entity\Traits\ActivityPubActorTrait; use App\Message\ActivityPub\Outbox\DeliverMessage; +use Psr\Log\LoggerInterface; use Symfony\Component\Messenger\MessageBusInterface; readonly class DeliverManager @@ -13,6 +14,7 @@ public function __construct( private SettingsManager $settingsManager, private MessageBusInterface $bus, + private LoggerInterface $logger, ) { } @@ -32,6 +34,11 @@ public function deliver(array $inboxes, array $activity): void continue; } + if ($this->settingsManager->isLocalUrl($inboxUrl)) { + $this->logger->warning('tried delivering to a local url, {payload}', ['payload' => $activity]); + continue; + } + $this->bus->dispatch(new DeliverMessage($inboxUrl, $activity)); } }