function parseHeader (str) {
      var lines = str.split(/\r?\n/)
      var fields = {}
      var index
      var line
      var field
      var val

      lines.pop() // trailing CRLF

      for (var i = 0, len = lines.length; i < len; ++i) {
        line = lines[i]
        index = line.indexOf(':')
        field = line.slice(0, index).toLowerCase()
        val = trim(line.slice(index + 1))
        fields[field] = val
      }

      return fields
    }
Parse the given header `str` into
an object containing the mapped fields.

@param {String} str
@return {Object}
@api private