diff --git a/lib/context.js b/lib/context.js index 032b675..fd7e6a2 100644 --- a/lib/context.js +++ b/lib/context.js @@ -26,14 +26,19 @@ module.exports = { /** * Return JSON representation. * + * Here we explicitly invoke .toJSON() on each + * object, as iteration will otherwise fail due + * to the getters and cause utilities such as + * clone() to fail. + * * @return {Object} * @api public */ toJSON: function(){ return { - request: this.request, - response: this.response + request: this.request.toJSON(), + response: this.response.toJSON() } },