[fix] When client request is aborted, abort server request

This commit is contained in:
Maciej Małecki 2011-10-29 18:11:05 +02:00
parent 80c216df0c
commit 4d43d81e5c

View File

@ -322,6 +322,13 @@ HttpProxy.prototype.proxyRequest = function (req, res, buffer) {
//
reverseProxy.once('error', proxyError);
//
// If `req` is aborted, we abort our `reverseProxy` request as well.
//
req.on('aborted', function () {
reverseProxy.abort();
});
//
// For each data `chunk` received from the incoming
// `req` write it to the `reverseProxy` request.