mirror of
https://github.com/tenrok/axios.git
synced 2026-06-20 20:00:40 +03:00
Adding test for compression error handling
This commit is contained in:
@@ -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) {
|
testUTF8: function (test) {
|
||||||
var str = Array(100000).join('ж');
|
var str = Array(100000).join('ж');
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user