fix: flush proxied responses before the dev supervisor closes the client (#11530)

* fix: flush proxied responses before the dev supervisor closes the client

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore: shorten dev supervisor close-path comment

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Guilhem
2026-10-05 14:16:22 +00:00
committed by GitHub
co-authored by Claude Opus 5.5
parent e76781cc27
commit cefb195376
+5 -1
View File
@@ -339,8 +339,12 @@ class Target {
client.destroy()
upstream.destroy()
}
// An upstream close must not destroy the client: `destroy` drops bytes still queued
// toward a slow client, truncating the response body. `pipe` already ends the client
// once those bytes are flushed.
upstream.on('error', teardown)
upstream.on('close', teardown)
client.on('error', teardown)
upstream.on('close', () => this.liveSockets.delete(client))
client.on('close', teardown)
},
(err) => {