static headersToGenericObject_(xhr) {
    // Since Edge incorrectly return the header with a leading new
    // line character ('\n'), we trim the header here.
    const headerLines = xhr.getAllResponseHeaders().trim().split('\r\n');
    const headers = {};
    for (const header of headerLines) {
      /** @type {!Array<string>} */
      const parts = header.split(': ');
      headers[parts[0].toLowerCase()] = parts.slice(1).join(': ');
    }
    return headers;
  }
@param {!XMLHttpRequest} xhr
@return {!Object<string, string>}
@private