Content-Length: 276942 | pFad | https://github.com/EventSource/eventsource/commit/61e1b19c8616aa151835a4ae599b299afb574ebf

40 test: destroy both proxied request and response on close · EventSource/eventsource@61e1b19 · GitHub
Skip to content

Commit 61e1b19

Browse files
committed
test: destroy both proxied request and response on close
1 parent bc92424 commit 61e1b19

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/eventsource_test.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,16 +93,17 @@ function createProxy (target, protocol, callback) {
9393
upstreamRes.pipe(res)
9494
})
9595

96-
proxied.push(upstreamReq)
96+
proxied.push({req: upstreamReq, res: res})
9797
upstreamReq.end()
9898
})
9999

100100
servers.push(server)
101101

102102
var oldClose = server.close
103103
server.close = function (closeCb) {
104-
proxied.forEach(function (res) {
105-
res.abort()
104+
proxied.forEach(function (pair) {
105+
pair.req.abort()
106+
pair.res.destroy()
106107
})
107108

108109
oldClose.call(server, function () {

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/EventSource/eventsource/commit/61e1b19c8616aa151835a4ae599b299afb574ebf

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy