throw new HTTPException\BadRequestException();
}
+ header('Vary: Accept', false);
+
if (!ActivityPub::isRequest()) {
DI::baseUrl()->redirect(str_replace('objects/', 'display/', DI::args()->getQueryString()));
}
// Relaxed CORS header for public items
header('Access-Control-Allow-Origin: *');
- header('Vary: Accept', false);
-
System::jsonExit($data, 'application/activity+json');
}
}
$blocked = null;
}
- header('Vary: Accept', false);
-
$hooked = '';
Hook::callAll('about_hook', $hooked);
protected function rawContent(array $request = [])
{
+ header('Vary: Accept', false);
+
// @TODO: Replace with parameter from router
if (DI::args()->getArgc() <= 1 || (DI::args()->getArgv()[1] !== 'json')) {
if (!ActivityPub::isRequest()) {
$data = ActivityPub\Transmitter::getProfile(0);
header('Access-Control-Allow-Origin: *');
header('Cache-Control: max-age=23200, stale-while-revalidate=23200');
- header('Vary: Accept', false);
System::jsonExit($data, 'application/activity+json');
} catch (HTTPException\NotFoundException $e) {
System::jsonError(404, ['error' => 'Record not found']);
protected function content(array $request = []): string
{
+ header('Vary: Accept', false);
+
if (ActivityPub::isRequest()) {
$this->baseUrl->redirect(str_replace('display/', 'objects/', $this->args->getQueryString()));
}
$output .= $this->getDisplayData($item);
- header('Vary: Accept', false);
-
return $output;
}
protected function rawContent(array $request = [])
{
+ header('Vary: Accept', false);
+
if (ActivityPub::isRequest()) {
$user = $this->database->selectFirst('user', ['uid'], ['nickname' => $this->parameters['nickname'] ?? '', 'account_removed' => false]);
if ($user) {
$data = ActivityPub\Transmitter::getProfile($user['uid']);
header('Access-Control-Allow-Origin: *');
header('Cache-Control: max-age=23200, stale-while-revalidate=23200');
- header('Vary: Accept', false);
System::jsonExit($data, 'application/activity+json');
} catch (HTTPException\NotFoundException $e) {
System::jsonError(404, ['error' => 'Record not found']);
System::jsonError(404, []);
}
}
-
- header('Vary: Accept', false);
}
protected function content(array $request = []): string
throw new NotFoundException('Invalid host name for xrd query: ' . $host);
}
+ header('Vary: Accept', false);
+
if ($name == User::getActorName()) {
$owner = User::getSystemAccount();
if (empty($owner)) {
]
];
header('Access-Control-Allow-Origin: *');
- header('Vary: Accept', false);
System::jsonExit($json, 'application/jrd+json; charset=utf-8');
}
];
header('Access-Control-Allow-Origin: *');
- header('Vary: Accept', false);
System::jsonExit($json, 'application/jrd+json; charset=utf-8');
}
]);
header('Access-Control-Allow-Origin: *');
- header('Vary: Accept', false);
System::httpExit($xmlString, Response::TYPE_XML, 'application/xrd+xml');
}
}