Skip to content

Commit 0d84511

Browse files
committed
Merge pull request #8 from mjsalinger/fix-express-response
Fix express response
2 parents d8dd547 + a4310e8 commit 0d84511

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

index.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,7 @@ ExpressOAuthServer.prototype.token = function() {
123123

124124
var handleResponse = function(req, res, response) {
125125
res.set(response.headers);
126-
127-
res.send(response.body);
128-
res.status(response.status);
126+
res.status(response.status).send(response.body);
129127
};
130128

131129
/**
@@ -141,8 +139,7 @@ var handleError = function(e, req, res, response) {
141139
return res.status(e.code);
142140
}
143141

144-
res.send({ error: e.name, error_description: e.message });
145-
res.status(e.code);
142+
res.status(e.code).send({ error: e.name, error_description: e.message });
146143
};
147144

148145
/**

0 commit comments

Comments
 (0)