Skip to content

Commit

Permalink
prevent unnecessary req.abort()
Browse files Browse the repository at this point in the history
  • Loading branch information
flotwig committed Nov 8, 2021
1 parent 425b79a commit bb002b5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/proxy/lib/http/request-middleware.ts
Expand Up @@ -171,6 +171,8 @@ const SendRequestOutgoing: RequestMiddleware = function () {
req.on('error', this.onError)
req.on('response', (incomingRes) => this.onResponse(incomingRes, req))
this.req.socket.on('close', () => {
if (!this.req.aborted) return

this.debug('request aborted')
req.abort()
})
Expand Down

0 comments on commit bb002b5

Please sign in to comment.