bugfix request compat opts.auth.bearer

This commit is contained in:
AJ ONeal 2020-03-12 01:59:33 -06:00
parent 5b5cd36aa5
commit 812f4e6062
1 changed files with 3 additions and 2 deletions

View File

@ -264,9 +264,10 @@ function setDefaults(defs) {
'[Warn] setting `sendImmediately: false` is not yet supported. Please open an issue if this is an important feature that you need.'
);
}
if (opts.bearer) {
// [request-compat]
if (opts.auth.bearer) {
// having a shortcut for base64 encoding makes sense, but this? Eh, whatevs...
finalOpts.header.Authorization = 'Bearer: ' + opts.bearer;
finalOpts.header.Authorization = 'Bearer ' + opts.auth.bearer;
}
}
if (opts.formData) {