From 600653e293e94bcc039f0fb29cde55826407d755 Mon Sep 17 00:00:00 2001 From: Nick Uraltsev Date: Wed, 18 May 2016 19:47:12 -0700 Subject: [PATCH] Adding test for compression error handling --- test/unit/adapters/http.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/unit/adapters/http.js b/test/unit/adapters/http.js index acd0b30..9351fcb 100644 --- a/test/unit/adapters/http.js +++ b/test/unit/adapters/http.js @@ -102,6 +102,18 @@ module.exports = { }); }, + testGunzipErrorHandling: function (test) { + server = http.createServer(function (req, res) { + res.setHeader('Content-Type', 'application/json;charset=utf-8'); + res.setHeader('Content-Encoding', 'gzip'); + res.end('invalid response'); + }).listen(4444, function () { + axios.get('http://localhost:4444/').catch(function (error) { + test.done(); + }); + }); + }, + testUTF8: function (test) { var str = Array(100000).join('ж');