mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-20 06:07:55 +00:00
Simplify header assignment in server.request
This commit is contained in:
parent
7524a0efa8
commit
e6570efbaf
@ -23,10 +23,10 @@ exports.request = (options = {}, callback) ->
|
||||
|
||||
_.defaults options,
|
||||
method: 'GET'
|
||||
headers: {}
|
||||
|
||||
if savedToken?
|
||||
options.headers = _.extend options.headers,
|
||||
options.headers ?= {}
|
||||
_.extend options.headers,
|
||||
'Authorization': "Bearer #{savedToken}"
|
||||
|
||||
request(options, callback)
|
||||
|
Loading…
Reference in New Issue
Block a user