function headersGetter(headers) {
  var headersObj;

  return function(name) {
    if (!headersObj) headersObj =  parseHeaders(headers);

    if (name) {
      var value = headersObj[lowercase(name)];
      if (value === undefined) {
        value = null;
      }
      return value;
    }

    return headersObj;
  };
}
Returns a function that provides access to parsed headers.

Headers are lazy parsed when first requested.
@see parseHeaders

@param {(string|Object)} headers Headers to provide access to.
@returns {function(string=)} Returns a getter function which if called with:

  - if called with an argument returns a single header value or null
  - if called with no arguments returns an object containing all headers.