From 1835150e7229602d768451be024e039e94f146e3 Mon Sep 17 00:00:00 2001 From: Ian Cervantez Date: Wed, 16 May 2018 07:15:34 -0500 Subject: [PATCH] Updating PR comment --- lib/framework/koa.js | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/lib/framework/koa.js b/lib/framework/koa.js index fd19055..091e771 100644 --- a/lib/framework/koa.js +++ b/lib/framework/koa.js @@ -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) }