mirror of
https://code.castopod.org/adaures/castopod.git
synced 2024-08-27 14:27:17 +02:00
- rename podlibre to adaures - rename castopod-host to castopod - simplify README and redirect to docs site - move INSTALL and UPDATE docs - add new gitlabci pipeline to deploy docs - upgrade node to v16 in Dockerfile
33 lines
790 B
PHP
33 lines
790 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/**
|
|
* @copyright 2021 Ad Aures
|
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
|
* @link https://castopod.org/
|
|
*/
|
|
|
|
namespace Modules\Fediverse\Controllers;
|
|
|
|
use CodeIgniter\Controller;
|
|
use CodeIgniter\Exceptions\PageNotFoundException;
|
|
use CodeIgniter\HTTP\ResponseInterface;
|
|
use Exception;
|
|
use Modules\Fediverse\WebFinger;
|
|
|
|
class WebFingerController extends Controller
|
|
{
|
|
public function index(): ResponseInterface
|
|
{
|
|
try {
|
|
$webfinger = new WebFinger($this->request->getGet('resource'));
|
|
} catch (Exception) {
|
|
// return 404, actor not found
|
|
throw PageNotFoundException::forPageNotFound();
|
|
}
|
|
|
|
return $this->response->setJSON($webfinger->toArray());
|
|
}
|
|
}
|