Simplify header assignment in server.request

This commit is contained in:
Juan Cruz Viotti 2014-11-18 10:04:26 -04:00
parent 7524a0efa8
commit e6570efbaf

View File

@ -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)