diff options
author | isaacs <i@izs.me> | 2013-06-25 17:37:25 -0700 |
---|---|---|
committer | isaacs <i@izs.me> | 2013-06-26 11:25:13 -0700 |
commit | 7c17ca203fe13c18ec021a25f7559501a9f97ab3 (patch) | |
tree | e84340db65fbd0cce5f7f250906b76baf6633e4b | |
parent | bd54fd3553f1a04b419acd4164ad4054c6ead513 (diff) | |
download | node-7c17ca203fe13c18ec021a25f7559501a9f97ab3.tar.gz |
NodeConf 2013: exercize extra creditnodeconf-2013
-rw-r--r-- | lib/_http_outgoing.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/_http_outgoing.js b/lib/_http_outgoing.js index 459b833da..1a0650bba 100644 --- a/lib/_http_outgoing.js +++ b/lib/_http_outgoing.js @@ -578,14 +578,14 @@ OutgoingMessage.prototype._flush = function() { } }; -OutgoingMessage.prototype.json = function(obj) { +OutgoingMessage.prototype.json = function(obj, indent, cb) { try { - var json = JSON.stringify(obj); + var json = JSON.stringify(obj, null, indent); } catch (er) { return this.emit('error', er); } this.setHeader('content-type', 'application/json'); this.setHeader('content-length', Buffer.byteLength(json, 'utf8')); - this.end(json, 'utf8'); + this.end(json, 'utf8', cb); }; |