mirror of
https://github.com/directus/directus.git
synced 2026-02-17 19:21:32 -05:00
set statuscode to 204 if no content is send (#10569)
* set statuscode to 204 if no content is send this is currently wrong for the DELETE Http Method in directus, which sends 200 status code although no content is served * make linter happy Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com> Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
This commit is contained in:
@@ -80,8 +80,10 @@ export const respond: RequestHandler = asyncHandler(async (req, res) => {
|
||||
|
||||
if (Buffer.isBuffer(res.locals.payload)) {
|
||||
return res.end(res.locals.payload);
|
||||
} else {
|
||||
} else if (res.locals.payload) {
|
||||
return res.json(res.locals.payload);
|
||||
} else {
|
||||
return res.status(204).end();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user