function headersArrayToObject(rawHeaders) {
  if (!Array.isArray(rawHeaders)) {
    throw Error('Expected a header array')
  }

  const accumulator = {}

  forEachHeader(rawHeaders, (value, fieldName) => {
    addHeaderLine(accumulator, fieldName, value)
  })

  return accumulator
}
Converts an array of raw headers to an object, using the same rules as Nodes `http.IncomingMessage.headers`.

Header names/keys are lower-cased.