summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPavel Lang <langpavel@phpskelet.org>2012-09-18 18:26:08 +0200
committerBen Noordhuis <info@bnoordhuis.nl>2012-09-28 02:57:01 +0200
commitb38277be266cfd6b6c3cc9e00730898f62a11f6e (patch)
treee152b00554641e78a5491db1eae40fc01f1e21e3 /lib
parentac17dc1764700f7413c240982c43717c41553ab0 (diff)
downloadandroid-node-v8-b38277be266cfd6b6c3cc9e00730898f62a11f6e.tar.gz
android-node-v8-b38277be266cfd6b6c3cc9e00730898f62a11f6e.tar.bz2
android-node-v8-b38277be266cfd6b6c3cc9e00730898f62a11f6e.zip
http: add response.headersSent property
Boolean property getter. True if headers was sent, false otherwise.
Diffstat (limited to 'lib')
-rw-r--r--lib/http.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/http.js b/lib/http.js
index e4d0dcd8f3..c4e0a77aad 100644
--- a/lib/http.js
+++ b/lib/http.js
@@ -699,6 +699,12 @@ OutgoingMessage.prototype._renderHeaders = function() {
};
+Object.defineProperty(OutgoingMessage.prototype, 'headersSent', {
+ configurable: true,
+ enumerable: true,
+ get: function () { return !!this._header; }
+});
+
OutgoingMessage.prototype.write = function(chunk, encoding) {
if (!this._header) {