2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-08 17:22:34 +03:00

Fixing 245:

Formatting and adding tests
This commit is contained in:
Andrew Crites
2016-02-28 22:51:20 -05:00
parent 76cb7eeba9
commit 116f5fca88
2 changed files with 20 additions and 6 deletions
+15 -1
View File
@@ -113,5 +113,19 @@ module.exports = {
test.done();
});
});
}
},
testBasicAuth: function (test) {
server = http.createServer(function (req, res) {
console.log(req.headers);
res.end(req.headers.authorization);
}).listen(4444, function () {
var user = 'foo';
axios.get('http://' + user + '@localhost:4444/').then(function (res) {
var base64 = new Buffer(user + ':', 'utf8').toString('base64');
test.equal(res.data, 'Basic ' + base64);
test.done();
});
});
},
};