function parseHeaders (headers) {
    var parsed = createMap();
    var i;

    function fillInParsed (key, val) {
      if (key) {
        parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
      }
    }

    if (angular.isString(headers)) {
      angular.forEach(headers.split('\n'), function (line) {
        i = line.indexOf(':');
        fillInParsed(angular.lowercase(trim(line.substr(0, i))), trim(line.substr(i + 1)));
      });
    } else if (angular.isObject(headers)) {
      angular.forEach(headers, function (headerVal, headerKey) {
        fillInParsed(angular.lowercase(headerKey), trim(headerVal));
      });
    }

    return parsed;
  }
/**
   * Parse headers into key value object
   *
   * @param {string} headers Raw headers as a string
   * @returns {Object} Parsed headers as key value object
   */
Parse headers into key value object
@param {string} headers Raw headers as a string
@returns {Object} Parsed headers as key value object
Parse headers into key value object @param { string } headers Raw headers as a string @returns { Object } Parsed headers as key value object
function parseHeaders (headers) {
    var parsed = createMap();
    var i;
    function fillInParsed (key, val) {
      if (key) {
        parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
      }
    }
    if (angular.isString(headers)) {
      angular.forEach(headers.split('\n'), function (line) {
        i = line.indexOf(':');
        fillInParsed(angular.lowercase(trim(line.substr(0, i))), trim(line.substr(i + 1)));
      });
    } else if (angular.isObject(headers)) {
      angular.forEach(headers, function (headerVal, headerKey) {
        fillInParsed(angular.lowercase(headerKey), trim(headerVal));
      });
    }
    return parsed;
  }
function parseHeaders ( headers ) { var parsed = createMap ( ) ; var i ; function fillInParsed ( key , val ) { if ( key ) { parsed [ key ] = parsed [ key ] ? parsed [ key ] + ', ' + val : val ; } } if ( angular . isString ( headers ) ) { angular . forEach ( headers . split ( '\n' ) , function ( line ) { i = line . indexOf ( ':' ) ; fillInParsed ( angular . lowercase ( trim ( line . substr ( 0 , i ) ) ) , trim ( line . substr ( i + 1 ) ) ) ; } ) ; } else if ( angular . isObject ( headers ) ) { angular . forEach ( headers , function ( headerVal , headerKey ) { fillInParsed ( angular . lowercase ( headerKey ) , trim ( headerVal ) ) ; } ) ; } return parsed ; }
Parse headers into key value object
 @param {string} headers Raw headers as a string
 @returns {Object} Parsed headers as key value object
Parse headers into key value object @param { string } headers Raw headers as a string @returns { Object } Parsed headers as key value object