2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-14 18:42:33 +03:00

Fixing Authorization header with basic auth

The http adapater did not remove a custom Authorization header when auth is set.
This commit is contained in:
Christian Schuhmann
2016-08-03 12:16:55 +02:00
parent 8332392bfd
commit 1ffcbb0369
2 changed files with 20 additions and 1 deletions
+4
View File
@@ -62,6 +62,10 @@ module.exports = function httpAdapter(config) {
auth = urlUsername + ':' + urlPassword;
}
if (auth) {
delete headers.Authorization;
}
var isHttps = parsed.protocol === 'https:';
var agent = isHttps ? config.httpsAgent : config.httpAgent;