From 7d8245e8853b204e555a222680f66451025c1f2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Santiago=20Rodr=C3=ADguez?= Date: Wed, 15 Feb 2017 22:33:38 +0100 Subject: [PATCH] Update XMLHttpRequest.js Fixed undefined exception when the setEncoding method is not available (it happens on Meteor applications using the node-modules on the client). --- lib/XMLHttpRequest.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/XMLHttpRequest.js b/lib/XMLHttpRequest.js index 4893913..7551057 100644 --- a/lib/XMLHttpRequest.js +++ b/lib/XMLHttpRequest.js @@ -425,7 +425,7 @@ exports.XMLHttpRequest = function() { return; } - response.setEncoding("utf8"); + if (response.setEncoding) response.setEncoding("utf8"); setState(self.HEADERS_RECEIVED); self.status = response.statusCode;