passThroughOnException without POST data?

Hi :slight_smile:

I thought that event.passThroughOnException(); should pass requests to my origin, but it seems that it’s missing post data. I think that’s because the request body is a readable stream and once read it cannot be read again, but how to manage this scenario?

addEventListener('fetch', (event) => {
  event.passThroughOnException();
  event.respondWith(handleRequest(event));
});

async function handleRequest(event: FetchEvent): Promise<Response> {
  const response = await fetch(event.request);

  // do something here that potentially raises an Exception
  // @ts-ignore
  ohnoez(); // deliberate failure

  return response;
}

How to make sure that event.passThroughOnException(); will send post data too?

Thank you for your help!

For ppl coming here: https://stackoverflow.com/questions/63472642/event-passthroughonexception-sends-requests-to-origin-but-without-post-data/63478802#63478802 :slight_smile: