Page function throw exception when contains fetch contains accept header

const headers = new Headers();
headers.set('Content-Type', 'application/json');
headers.set('Accept', 'application/json');
const newReq = new Request('https://api.cobalt.tools/api/json', {
  method: 'POST',
  headers: headers,
  body: JSON.stringify(payload),
});

It will throw following errors

  "stack": "    at run7 (functionsWorker-0.9172056921113851.js:425:19)
at async onRequest8 (functionsWorker-0.9172056921113851.js:374:12)
at async next (functionsWorker-0.9172056921113851.js:915:26)
at async Object.fetch (functionsWorker-0.9172056921113851.js:929:14)",

When remove Accept header, fetch successfully…

It turns out that it’s await resp.json() cause this issue, change to await resp.text() fix this.