From 812f4e6062d368aa37f8569168020de8164fb9dc Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 12 Mar 2020 01:59:33 -0600 Subject: [PATCH] bugfix request compat opts.auth.bearer --- index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index c0eb757..cb09fe8 100644 --- a/index.js +++ b/index.js @@ -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) {