Commit c2b8c4e0 authored by Vadym Gidulian's avatar Vadym Gidulian

Removed response body if response claimed as empty or status code is 204 or 304

parent ebd36637
...@@ -49,7 +49,9 @@ module.exports = { ...@@ -49,7 +49,9 @@ module.exports = {
} }
} }
if (!response && !res[IS_EMPTY]) return res.status(404).send(response); if (!response && !res[IS_EMPTY]) return res.status(404).send();
if (res[IS_EMPTY] || [204, 304].includes(res.statusCode)) response = null;
res.status(res.statusCode || 200).send(response); res.status(res.statusCode || 200).send(response);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment