pcvnes
pcvnes

Reputation: 977

HTTP 200 and null response in Chromium >=94

After my locally installed browsers (Edge Chromium and Google Chrome) were updated to a version with Chromium >=94 fetching large files do fail.

I tested with two implementations, Fetch and XmlHttpRequest. In both implementations the HTTP status and response are the same. In browsers with Chromium version 93 the expected response is returned. When running the same code in browsers with Chromium versie 94, i do get a HTTP 200, but response is always null

Any idea if this is a specific Chromium 94 issue ?

return new Promise((resolve, reject) => {
  var url = getBaseUrl() + serviceUrl;
  fetch(url,{
    method: "GET",
    headers: {
      importance: "low"
    }
  }).then((response) => {
    if (response.status === 200) {
      response.arrayBuffer().then(buffer => resolve(buffer))
    } else {
      reject(response);
    }
  })

});

and

return new Promise((resolve, reject) => {
  const xhr = new XMLHttpRequest();
  var url = getBaseUrl() + serviceUrl;
  xhr.open('GET', url, true);
  xhr.responseType = 'arraybuffer';
  xhr.onload = function () {
    if (this.status === 200) {
      resolve(this.response);
    } else {
      reject(this.response);
    }
  };
  xhr.send();
});

Upvotes: 1

Views: 153

Answers (0)

Related Questions