mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
[fix] When client request is aborted, abort server request
This commit is contained in:
parent
80c216df0c
commit
4d43d81e5c
@ -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.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user