const normalizedConfigHeaders = function()

in src/middleware/headers.js [14:31]


const normalizedConfigHeaders = function(spec, config) {
  const out = config || [];
  if (_.isArray(config)) {
    const _isAllowed = function(headerToSet) {
      return _.includes(spec.allowedHeaders, headerToSet.key.toLowerCase());
    };

    for (let i = 0; i < config.length; i++) {
      config[i].source = slasher(config[i].source);
      config[i].headers = config[i].headers || [];
      if (spec.allowedHeaders) {
        config[i].headers = config[i].headers.filter(_isAllowed);
      }
    }
  }

  return out;
};