parseHttp1Headers_(str) {
    const chunks = str.trim().split('\r\n');
    const headers = {};
    for (let i = 0; i < chunks.length; i++) {
      const pos = chunks[i].indexOf(':');
      headers[chunks[i].substring(0, pos).trim()] =
          chunks[i].substring(pos + 1).trim();
    }
    return headers;
  }
Parse HTTP headers

@private
@param {string} str The raw http header string
@return {!Object} The header:value pairs