Skip to content

Commit

Permalink
[fix] When client request is aborted, abort server request
Browse files Browse the repository at this point in the history
  • Loading branch information
mmalecki committed Oct 29, 2011
1 parent 1eb8aab commit a95cf9b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/node-http-proxy/http-proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,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.
Expand Down

0 comments on commit a95cf9b

Please sign in to comment.