2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-11 18:02:32 +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
+5 -5
View File
@@ -47,10 +47,10 @@ module.exports = function httpAdapter(resolve, reject, config) {
// Parse url
var parsed = url.parse(config.url);
if (!auth && parsed.auth) {
var urlAuth = parsed.auth.split(":");
var urlUsername = urlAuth[0] || "";
var urlPassword = urlAuth[1] || "";
auth = urlUsername + ':' + urlPassword;
var urlAuth = parsed.auth.split(':');
var urlUsername = urlAuth[0] || '';
var urlPassword = urlAuth[1] || '';
auth = urlUsername + ':' + urlPassword;
}
var options = {
hostname: parsed.hostname,
@@ -59,7 +59,7 @@ module.exports = function httpAdapter(resolve, reject, config) {
method: config.method,
headers: headers,
agent: config.agent,
auth: auth || parsed.auth,
auth: auth
};
// Create the request