2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-11 18:02:32 +03:00

Adding test for maxRedirects option

This commit is contained in:
Nick Uraltsev
2016-05-31 18:29:32 -07:00
parent 4e7ca3dea3
commit 5c5a94007c
+16
View File
@@ -98,6 +98,22 @@ module.exports = {
});
},
testMaxRedirects: function (test) {
var i = 1;
server = http.createServer(function (req, res) {
res.setHeader('Location', '/' + i);
res.statusCode = 302;
res.end();
i++;
}).listen(4444, function () {
axios.get('http://localhost:4444/', {
maxRedirects: 3
}).catch(function (error) {
test.done();
});
});
},
testTransparentGunzip: function (test) {
var data = {
firstName: 'Fred',