diff --git a/lib/context.js b/lib/context.js index 4711bfd..03b2d29 100644 --- a/lib/context.js +++ b/lib/context.js @@ -35,8 +35,8 @@ module.exports = { toJSON: function(){ return { - request: this.request.toJSON(), - response: this.response.toJSON() + request: this.request, + response: this.response } }, diff --git a/test/context/toJSON.js b/test/context/toJSON.js index 5a63cba..bc3b159 100644 --- a/test/context/toJSON.js +++ b/test/context/toJSON.js @@ -11,7 +11,7 @@ describe('ctx.toJSON()', function(){ ctx.status = 200; ctx.body = '
Hey
'; - var obj = ctx.toJSON(); + var obj = JSON.parse(JSON.stringify(ctx)); var req = obj.request; var res = obj.response;