Unified JSON exit

This commit is contained in:
Michael 2022-04-09 11:58:01 +00:00
parent 344e12c4fc
commit d15023fe4b
21 changed files with 61 additions and 80 deletions

View file

@ -22,6 +22,7 @@
namespace Friendica\Module\WellKnown;
use Friendica\BaseModule;
use Friendica\Core\System;
use Friendica\DI;
/**
@ -51,8 +52,6 @@ class NodeInfo extends BaseModule
]
];
header('Content-type: application/json; charset=utf-8');
echo json_encode($nodeinfo, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
exit;
System::jsonExit($nodeinfo);
}
}

View file

@ -22,6 +22,7 @@
namespace Friendica\Module\WellKnown;
use Friendica\BaseModule;
use Friendica\Core\System;
use Friendica\DI;
use Friendica\Model\Search;
use Friendica\Protocol\Relay;
@ -76,8 +77,6 @@ class XSocialRelay extends BaseModule
$relay['protocols']['diaspora'] = ['receive' => DI::baseUrl()->get() . '/receive/public'];
}
header('Content-type: application/json; charset=utf-8');
echo json_encode($relay, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
exit;
System::jsonExit($relay);
}
}