diff --git a/lib/response.js b/lib/response.js index 796c23eb..a982f3d4 100644 --- a/lib/response.js +++ b/lib/response.js @@ -7,11 +7,15 @@ export function json(res, data = {}) { } export function send(res, data, type = 'text-plain') { - return res.status(200).setHeader('Content-Type', type).send(data); + res.setHeader('Content-Type', type); + + return res.status(200).send(data); } export function redirect(res, url) { - return res.status(303).setHeader('Location', url).end(); + res.setHeader('Location', url); + + return res.status(303).end(); } export function badRequest(res, msg = '400 Bad Request') {