diff --git a/lib/node-http-proxy/http-proxy.js b/lib/node-http-proxy/http-proxy.js index bf3c297..1ff76a6 100644 --- a/lib/node-http-proxy/http-proxy.js +++ b/lib/node-http-proxy/http-proxy.js @@ -218,14 +218,13 @@ HttpProxy.prototype.proxyRequest = function (req, res, buffer) { return; } - function ondata(chunk) { - if (res.writable) { - if (false === res.write(chunk) && response.pause) { - response.pause(); - } + if (res.writable) { + if (false === res.write(chunk) && response.pause) { + response.pause(); } } + } response.on('data', ondata);