1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-07 13:46:42 +02:00

feat(endpoints): fix api response headers and status codes

This commit is contained in:
Awilum
2021-09-22 23:23:20 +03:00
parent 8dd31c6437
commit 5373665f23

View File

@@ -151,8 +151,8 @@ class Api
$response->getBody()->write(serializers()->json()->encode($body));
}
$response->withStatus($status);
$response->withHeader('Content-Type', 'application/json;charset=' . registry()->get('flextype.settings.charset'));
$response = $response->withStatus($status);
$response = $response->withHeader('Content-Type', 'application/json;charset=' . registry()->get('flextype.settings.charset'));
return $response;
}