mirror of
https://github.com/tenrok/axios.git
synced 2026-06-23 20:40:40 +03:00
Adding test for maxRedirects option
This commit is contained in:
@@ -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) {
|
testTransparentGunzip: function (test) {
|
||||||
var data = {
|
var data = {
|
||||||
firstName: 'Fred',
|
firstName: 'Fred',
|
||||||
|
|||||||
Reference in New Issue
Block a user