Skip to content

Commit

Permalink
Updating PR comment
Browse files Browse the repository at this point in the history
  • Loading branch information
TigerC10 committed May 16, 2018
1 parent 35588c1 commit 1835150
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions lib/framework/koa.js
Expand Up @@ -108,24 +108,8 @@ function authenticate(passport, name, options, callback) {
// mock the `req` object
const req = createReqMock(ctx, options.assignProperty || passport._userProperty || 'user')

/*
* res.end & res.send should basically behave the same
* res.end only takes strings (but should be okay for the mock to take more)
* res.send can send a buffer, object, array, or string
*/
function setBodyAndResolve(content) {
switch (typeof content) {
case 'Buffer':
ctx.body = content.toString()
break
case 'object':
ctx.body = JSON.stringify(content)
break
case 'string':
default:
ctx.body = content
break
}
if (content) ctx.body = content
resolve(false)
}

Expand Down

0 comments on commit 1835150

Please sign in to comment.