diff --git a/helpers/util.js b/helpers/util.js index 1e1d20f70..6c5dbac85 100644 --- a/helpers/util.js +++ b/helpers/util.js @@ -139,9 +139,16 @@ function getGzipped(url) { url: url, responseType:'stream' }).then(res => { - var gunzip = zlib.createGunzip() - res.data.pipe(gunzip) - gunzip.on('data', function(data) { + let stream + if(res.headers['content-type'] === 'application/xml') { + stream = res.data + } else { + let gunzip = zlib.createGunzip() + res.data.pipe(gunzip) + stream = gunzip + } + + stream.on('data', function(data) { buffer.push(data.toString()) }).on("end", function() { resolve(buffer.join(""))