diff --git a/lib/XMLHttpRequest.js b/lib/XMLHttpRequest.js index 4893913..50302d9 100644 --- a/lib/XMLHttpRequest.js +++ b/lib/XMLHttpRequest.js @@ -109,6 +109,7 @@ exports.XMLHttpRequest = function() { // Result & response this.responseText = ""; this.responseXML = ""; + this.response = Buffer.alloc(0); this.status = null; this.statusText = null; @@ -434,6 +435,7 @@ exports.XMLHttpRequest = function() { // Make sure there's some data if (chunk) { self.responseText += chunk; + self.response = Buffer.concat([self.response, chunk]); } // Don't emit state changes if the connection has been aborted. if (sendFlag) {