From 7036fbfd8c628b556919d1097e880a0ea3beff0c Mon Sep 17 00:00:00 2001 From: Bryce Neal Date: Sat, 14 Apr 2018 07:56:31 +0200 Subject: [PATCH] Add authentication header config option --- src/utils/send-request.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/utils/send-request.js b/src/utils/send-request.js index 90f436d47..a1f316c23 100644 --- a/src/utils/send-request.js +++ b/src/utils/send-request.js @@ -108,6 +108,10 @@ function requestAPI (config, options, callback) { const method = 'POST' const headers = {} + if (config.authorization) { + headers['Authorization'] = config.authorization + } + if (isNode) { // Browsers do not allow you to modify the user agent headers['User-Agent'] = config['user-agent']