aboutsummaryrefslogtreecommitdiff
path: root/node_modules/axios/lib/helpers/normalizeHeaderName.js
blob: 738c9fe40a28b3af6f8bbb16a1f450940ac66a8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
'use strict';

var utils = require('../utils');

module.exports = function normalizeHeaderName(headers, normalizedName) {
  utils.forEach(headers, function processHeader(value, name) {
    if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
      headers[normalizedName] = value;
      delete headers[name];
    }
  });
};