Creating a new query object works until you set all the parameters:
// request is event.request sent by browser here var req = new Request(request.url, { method: request.method, headers: request.headers, mode: 'same-origin', // need to set this properly credentials: request.credentials, redirect: 'manual' // let browser handle redirects });
You cannot use the original mode if it is navigate (why did you get the exception), and you probably want to pass the redirect back to the browser to change its URL instead of letting fetch handle it.
Make sure that you do not set the body in GET requests - you donβt like the selection, but browsers sometimes generate GET requests with the body when responding to redirects from POST requests. fetch doesn't like it.
pirxpilot
source share