function reformatHeaders(entry) {
  // If there are no headers, or it is not an object other than an array,
  // return |entry| without modification.
  if (!entry.params || entry.params.headers === undefined ||
      typeof entry.params.headers != 'object' ||
      entry.params.headers instanceof Array) {
    return entry;
  }

  // Duplicate the top level object, and |entry.params|, so the original
  // object
  // will not be modified.
  entry = shallowCloneObject(entry);
  entry.params = shallowCloneObject(entry.params);

  // Convert headers to an array.
  var headers = [];
  for (var key in entry.params.headers)
    headers.push(key + ': ' + entry.params.headers[key]);
  entry.params.headers = headers;

  return entry;
}
/**
 * If entry.param.headers exists and is an object other than an array,
 * converts
 * it into an array and returns a new entry.  Otherwise, just returns the
 * original entry.
 */
If entry.param.headers exists and is an object other than an array,
converts
it into an array and returns a new entry.  Otherwise, just returns the
original entry.
If entry . param . headers exists and is an object other than an array converts it into an array and returns a new entry . Otherwise just returns the original entry .
function reformatHeaders(entry) {
  if (!entry.params || entry.params.headers === undefined ||
      typeof entry.params.headers != 'object' ||
      entry.params.headers instanceof Array) {
    return entry;
  }
  entry = shallowCloneObject(entry);
  entry.params = shallowCloneObject(entry.params);
  var headers = [];
  for (var key in entry.params.headers)
    headers.push(key + ': ' + entry.params.headers[key]);
  entry.params.headers = headers;
  return entry;
}
function reformatHeaders ( entry ) { if ( ! entry . params || entry . params . headers === undefined || typeof entry . params . headers != 'object' || entry . params . headers instanceof Array ) { return entry ; } entry = shallowCloneObject ( entry ) ; entry . params = shallowCloneObject ( entry . params ) ; var headers = [ ] ; for ( var key in entry . params . headers ) headers . push ( key + ': ' + entry . params . headers [ key ] ) ; entry . params . headers = headers ; return entry ; }
If entry.param.headers exists and is an object other than an array,
 converts
 it into an array and returns a new entry.
If entry . param . headers exists and is an object other than an array converts it into an array and returns a new entry .
// If there are no headers, or it is not an object other than an array, // return |entry| without modification. // Duplicate the top level object, and |entry.params|, so the original // object // will not be modified. // Convert headers to an array.