mirror of
https://github.com/tenrok/axios.git
synced 2026-06-20 20:00:40 +03:00
Fixing password encoding with special characters in basic authentication (#1492)
* Fixing password encoding with special characters in basic authentication * Adding test to check if password with non-Latin1 characters pass Co-authored-by: petr.mares <petr.mares@linecorp.com> Co-authored-by: Jay <jasonsaayman@gmail.com>
This commit is contained in:
+1
-1
@@ -23,7 +23,7 @@ module.exports = function xhrAdapter(config) {
|
||||
// HTTP basic authentication
|
||||
if (config.auth) {
|
||||
var username = config.auth.username || '';
|
||||
var password = config.auth.password || '';
|
||||
var password = unescape(encodeURIComponent(config.auth.password)) || '';
|
||||
requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user