do NOT check Content-Type header as it's sometimes not set to application/json

parsing JSON will error out, if payload is no JSON anyway
happens with mark-as-spam and SpamTitan
This commit is contained in:
Ralf Becker 2021-07-19 10:24:58 +02:00
parent 59ac3f4bda
commit 3a618937a9

View File

@ -233,7 +233,7 @@ egw.extend('json', egw.MODULE_WND_LOCAL, function(_app, _wnd)
{
promise = (this.egw.window?this.egw.window:window).fetch(url, init)
.then((response) => {
if (!response.ok || !response.headers.get('Content-Type').startsWith('application/json')) {
if (!response.ok) {
throw response;
}
return response.json();