diff --git a/lib/http-proxy/passes/web-outgoing.js b/lib/http-proxy/passes/web-outgoing.js index 05ded881c..46352f6e3 100644 --- a/lib/http-proxy/passes/web-outgoing.js +++ b/lib/http-proxy/passes/web-outgoing.js @@ -137,9 +137,10 @@ module.exports = { // <-- writeStatusCode: function writeStatusCode(req, res, proxyRes) { // From Node.js docs: response.writeHead(statusCode[, statusMessage][, headers]) if(proxyRes.statusMessage) { - res.writeHead(proxyRes.statusCode, proxyRes.statusMessage); + res.statusCode = proxyRes.statusCode; + res.statusMessage = proxyRes.statusMessage; } else { - res.writeHead(proxyRes.statusCode); + res.statusCode = proxyRes.statusCode; } }