From b029ded11e3aa5d4e438ac7bcbf6601c6baf18fc Mon Sep 17 00:00:00 2001 From: Wilhelm Eklund Date: Tue, 8 Dec 2020 12:45:04 +0100 Subject: [PATCH] Make it possible to send in own encoder function as part of options object --- src/client.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/client.js b/src/client.js index f3960bf3f..a55651aaa 100644 --- a/src/client.js +++ b/src/client.js @@ -578,7 +578,9 @@ Request.prototype.auth = function (user, pass, options) { throw new Error('Cannot use basic auth, btoa is not a function'); }; - return this._auth(user, pass, options, encoder); + options.encoder = options.encoder || encoder; + + return this._auth(user, pass, options, options.encoder); }; /**