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:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user