From 5c5a94007c3c1807e0fd3c99457e1603b0d02511 Mon Sep 17 00:00:00 2001 From: Nick Uraltsev Date: Tue, 31 May 2016 18:29:32 -0700 Subject: [PATCH] Adding test for maxRedirects option --- test/unit/adapters/http.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/unit/adapters/http.js b/test/unit/adapters/http.js index 54a4c4a..f1c1abe 100644 --- a/test/unit/adapters/http.js +++ b/test/unit/adapters/http.js @@ -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',