Right now, it looks like trying to do a setHeader on the passed in proxyReq for POST requests fails. (see below:)
proxy.on('proxyReq', function(proxyReq, req, res, options) {
proxyReq.setHeader('origin', 'https://example.com');
});
The following error is thrown when the above tries to execute:
Error: Can't set headers after they are sent.
This seems to work totally fine for GET requests, just not POST requests. Managed to hack around it at first by wrapping the .setHeader call in check to make sure proxyReq._header was null, but it looks like that totally fails when Firefox tries to perform a POST request (the header doesn't get set).
The same thing appears to happen when trying to do res.setHeader, as suggested by #819.
Right now, it looks like trying to do a
setHeaderon the passed inproxyReqforPOSTrequests fails. (see below:)The following error is thrown when the above tries to execute:
This seems to work totally fine for
GETrequests, just notPOSTrequests. Managed to hack around it at first by wrapping the.setHeadercall in check to make sureproxyReq._headerwasnull, but it looks like that totally fails when Firefox tries to perform aPOSTrequest (the header doesn't get set).The same thing appears to happen when trying to do
res.setHeader, as suggested by #819.