0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-02-17 23:45:29 -05:00

Fixed Changed headers array to be local to notifyEntry

This commit is contained in:
Ryan Graham 2017-04-18 13:56:36 +01:00
parent 7d62824936
commit adb40fc5f4

View file

@ -19,9 +19,9 @@ var handleNotify = function(metadata, notifyEntry) {
} }
// provides fallback support, it's accept an Object {} and Array of {} // provides fallback support, it's accept an Object {} and Array of {}
if ( config.notify.headers && Array.isArray(config.notify.headers) ) { if ( notifyEntry.headers && Array.isArray(notifyEntry.headers) ) {
var header = {}; var header = {};
config.notify.headers.map(function(item) { notifyEntry.headers.map(function(item) {
if (Object.is(item, item)) { if (Object.is(item, item)) {
for (var key in item) { for (var key in item) {
header[key] = item[key]; header[key] = item[key];
@ -29,8 +29,8 @@ var handleNotify = function(metadata, notifyEntry) {
} }
}); });
options.headers = header; options.headers = header;
} else if (Object.is(config.notify.headers, config.notify.headers)) { } else if (Object.is(notifyEntry.headers, notifyEntry.headers)) {
options.headers = config.notify.headers; options.headers = notifyEntry.headers;
} }
options.method = notifyEntry.method options.method = notifyEntry.method