Skip to content

Commit d537686

Browse files
committed
fix: handle proxyRes error in upgrade
1 parent 7be1c2a commit d537686

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,9 @@ function proxy (req, resOrSocket, options, onRes, onError) {
240240
.join('\r\n') + '\r\n\r\n'
241241
)
242242

243-
// XXX Do we need to handle `proxyRes.on('error', ...)`?
243+
// XXX Does this overlap socket errors, i.e. duplicate emits?
244244
// (https://github.com/nodejs/node/issues/15360)
245+
proxyRes.on('error', callback)
245246

246247
proxySocket
247248
.on('error', callback)

0 commit comments

Comments
 (0)