From e5d6e90d5eacc19457846f4dadf5b9a658255cac Mon Sep 17 00:00:00 2001 From: Brian VanLoo Date: Tue, 24 May 2011 21:20:27 -0700 Subject: [PATCH] Consume end event for error status --- lib/browser.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/browser.js b/lib/browser.js index 1ad9950..3a9cb9e 100644 --- a/lib/browser.js +++ b/lib/browser.js @@ -228,7 +228,9 @@ Browser.prototype.request = function(method, path, options, fn, saveHistory){ self.request('GET', path, options, fn); // Error } else { - fn(res); + res.on('end', function() { + fn(res); + }); } });