diff --git a/lib/notify.js b/lib/notify.js index 9faceeb7f..c0658d0dd 100644 --- a/lib/notify.js +++ b/lib/notify.js @@ -13,7 +13,18 @@ module.exports.notify = function(metadata, config) { body: content } - if ( config.notify.headers ) { + // provides fallback support, it's accept an Object {} and Array of {} + if ( config.notify.headers && Array.isArray(config.notify.headers) ) { + var header = {}; + config.notify.headers.map(function(item) { + if (Object.is(item, item)) { + for (var key in item) { + header[key] = item[key]; + } + } + }); + options.headers = header; + } else if (Object.is(config.notify.headers, config.notify.headers)) { options.headers = config.notify.headers; }