Improved Mastodon API compatibility

This commit is contained in:
Michael 2025-03-01 12:38:09 +00:00
parent afcc5a9205
commit fb9a20feaa
11 changed files with 91 additions and 29 deletions

View file

@ -512,7 +512,7 @@ abstract class BaseModule implements ICanHandleRequests
* @throws HTTPException\InternalServerErrorException
* @see json_encode()
*/
public function jsonExit($content, string $content_type = 'application/json', int $options = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT)
public function jsonExit($content, string $content_type = 'application/json; charset=utf-8', int $options = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT)
{
$this->httpExit(json_encode($content, $options), ICanCreateResponses::TYPE_JSON, $content_type);
}