You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(standard-server): settle sendStandardResponse when client disconnects before sending (#1738)
Fixes#1735
`handle()` hung forever when the client disconnected while the procedure
was still running, because the response's `'close'` event had already
fired before `sendStandardResponse()` started listening for it.
Now:
- `sendStandardResponse` (node, fastify, aws-lambda) settles immediately
when the response is already ended and destroys the prepared body so
event iterators are cleaned up.
- `toAbortSignal` aborts immediately when the response is already
closed, including http/2 client cancels.
- Both detect an ended response via the new `isNodeResponseStreamEnded`
util, which also handles `Http2ServerResponse` (it hides its stream
state at runtime).
Verified with real http/1 and http/2 servers: aborted requests now
resolve instead of hanging.
0 commit comments