mirror of
https://github.com/openvk/openvk
synced 2025-04-19 14:43:01 +03:00
ActivityPub: Fix Content-type again
This commit is contained in:
parent
0a8b771af4
commit
624a2c088c
3 changed files with 5 additions and 3 deletions
|
@ -255,11 +255,11 @@ abstract class OpenVKPresenter extends SimplePresenter
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function returnJson(array $json): void
|
protected function returnJson(array $json, string $ct = "application/json"): void
|
||||||
{
|
{
|
||||||
$payload = json_encode($json, JSON_UNESCAPED_UNICODE);
|
$payload = json_encode($json, JSON_UNESCAPED_UNICODE);
|
||||||
$size = strlen($payload);
|
$size = strlen($payload);
|
||||||
header("Content-Type: application/json");
|
header("Content-Type: " . $ct);
|
||||||
header("Content-Length: $size");
|
header("Content-Length: $size");
|
||||||
exit($payload);
|
exit($payload);
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,7 +71,7 @@ final class UserPresenter extends OpenVKPresenter
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->returnJson($objUser);
|
$this->returnJson($objUser, CT_AP);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($user->getShortCode())
|
if($user->getShortCode())
|
||||||
|
|
|
@ -240,6 +240,8 @@ return (function() {
|
||||||
define('MONTH', 30 * DAY);
|
define('MONTH', 30 * DAY);
|
||||||
define('YEAR', 365 * DAY);
|
define('YEAR', 365 * DAY);
|
||||||
|
|
||||||
|
define('CT_AP', 'application/activity+json'); // Content-type of ActivityPub protocol
|
||||||
|
|
||||||
define("nullptr", NULL);
|
define("nullptr", NULL);
|
||||||
define("OPENVK_DEFAULT_INSTANCE_NAME", "OpenVK", false);
|
define("OPENVK_DEFAULT_INSTANCE_NAME", "OpenVK", false);
|
||||||
define("OPENVK_VERSION", "Altair Preview ($ver)", false);
|
define("OPENVK_VERSION", "Altair Preview ($ver)", false);
|
||||||
|
|
Loading…
Reference in a new issue