From a4310e85047ec2f5861dd945108ddcba8c18d713 Mon Sep 17 00:00:00 2001 From: Michael Salinger Date: Fri, 11 Mar 2016 07:18:31 -0500 Subject: [PATCH] Fix express response --- index.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index 291f8de..1afbbf2 100644 --- a/index.js +++ b/index.js @@ -123,9 +123,7 @@ ExpressOAuthServer.prototype.token = function() { var handleResponse = function(req, res, response) { res.set(response.headers); - - res.send(response.body); - res.status(response.status); + res.status(response.status).send(response.body); }; /** @@ -141,8 +139,7 @@ var handleError = function(e, req, res, response) { return res.status(e.code); } - res.send({ error: e.name, error_description: e.message }); - res.status(e.code); + res.status(e.code).send({ error: e.name, error_description: e.message }); }; /**