Skip to content

Commit a95cf9b

Browse files
committed
[fix] When client request is aborted, abort server request
1 parent 1eb8aab commit a95cf9b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/node-http-proxy/http-proxy.js

+7
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,13 @@ HttpProxy.prototype.proxyRequest = function (req, res, buffer) {
284284
//
285285
reverseProxy.once('error', proxyError);
286286

287+
//
288+
// If `req` is aborted, we abort our `reverseProxy` request as well.
289+
//
290+
req.on('aborted', function () {
291+
reverseProxy.abort();
292+
});
293+
287294
//
288295
// For each data `chunk` received from the incoming
289296
// `req` write it to the `reverseProxy` request.

0 commit comments

Comments
 (0)