normalizeHeaderName.js 357 B

123456789101112
  1. 'use strict';
  2. var utils = require('../utils');
  3. module.exports = function normalizeHeaderName(headers, normalizedName) {
  4. utils.forEach(headers, function processHeader(value, name) {
  5. if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
  6. headers[normalizedName] = value;
  7. delete headers[name];
  8. }
  9. });
  10. };