From bffb758243ca19d334696a07c8091cf5fb75fe7b Mon Sep 17 00:00:00 2001 From: koichik Date: Sat, 30 Jul 2011 00:18:35 +0900 Subject: [PATCH] Fix http.ClientRequest crashes if end() was called twice Fixes #1417. Fixes #1223. --- lib/http2.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/http2.js b/lib/http2.js index 55b43282e9e..bc87442f64f 100644 --- a/lib/http2.js +++ b/lib/http2.js @@ -648,6 +648,9 @@ OutgoingMessage.prototype.addTrailers = function(headers) { OutgoingMessage.prototype.end = function(data, encoding) { + if (this.finished) { + return false; + } if (!this._header) { this._implicitHeader(); }