add explicit .toJSON() calls to ctx.toJSON()

This commit is contained in:
TJ Holowaychuk 2013-12-29 10:19:21 -08:00
parent 88fb4c841d
commit 14fe56e632

View file

@ -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()
}
},