I have created an extension for a production app, that intercepts fetch calls to serve static json responses for demo purposes.
Problem: For POST requests, the browser does not like me to redirect to a GET of a local extension path, like this:
action: {
type: 'redirect',
redirect: {
extensionPath: '/data/response.json'
}
}
In the browser console, I see net::ERR_UNSAFE_REDIRECT
Everything works great for GET requests.
Is there anything I can do to mock json responses to POST fetch calls, using local extension data?
From what I understand, declarativeNetRequest redirects get converted to GET by default, but I'm wondering if the redirect is a 307 which tries to maintain the POST body? (which I don't care about, since I am mocking the response).