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

Fixing requestHeaders.Authorization (#3287)

This commit is contained in:
Allan Cruz
2020-09-19 23:19:48 -03:00
committed by GitHub
parent e8c6e19141
commit 04d45f2091
2 changed files with 16 additions and 2 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ module.exports = function xhrAdapter(config) {
// HTTP basic authentication
if (config.auth) {
var username = config.auth.username || '';
var password = unescape(encodeURIComponent(config.auth.password)) || '';
var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';
requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
}