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