2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-05 16:42:32 +03:00

Resolving conflicts and modifying http adapter to not change status code error range

This commit is contained in:
Nick Uraltsev
2016-05-31 17:53:45 -07:00
2 changed files with 33 additions and 4 deletions
+19
View File
@@ -79,6 +79,25 @@ module.exports = {
});
},
testNoRedirect: function (test) {
server = http.createServer(function (req, res) {
res.setHeader('Location', '/foo');
res.statusCode = 302;
res.end();
}).listen(4444, function () {
axios.get('http://localhost:4444/', {
maxRedirects: 0,
validateStatus: function () {
return true;
}
}).then(function (res) {
test.equal(res.status, 302);
test.equal(res.headers['location'], '/foo');
test.done();
});
});
},
testTransparentGunzip: function (test) {
var data = {
firstName: 'Fred',