File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed
packages/open-next/src/http Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change 22" @opennextjs/aws " : patch
33---
44
5- fix(dev-overrides) : Add automatic response cleanup via onClose callback
5+ fix: Add automatic response cleanup via AbortSignal
66
7- This changes will make ` request.signal.onabort ` work in route handlers for ` node ` and ` express-dev ` wrappers.
7+ These changes will make ` request.signal.onabort ` work in route handlers for ` node ` , ` cloudflare- node` and ` express-dev ` wrappers.
Original file line number Diff line number Diff line change @@ -85,13 +85,11 @@ export class OpenNextNodeResponse extends Transform implements ServerResponse {
8585 this . statusCode = statusCode ;
8686 }
8787
88- // We want to destroy this response when the original response is closed. (i.e when the client disconnects)
88+ // We want to destroy this response when the original response/request is closed. (i.e when the client disconnects)
8989 // This is to support `request.signal.onabort` in route handlers
90- if ( streamCreator ?. abortSignal ) {
91- streamCreator . abortSignal . addEventListener ( "abort" , ( ) => {
90+ streamCreator ?. abortSignal ?. addEventListener ( "abort" , ( ) => {
9291 this . destroy ( ) ;
93- } ) ;
94- }
92+ } ) ;
9593 }
9694
9795 // Necessary for next 12
You can’t perform that action at this time.
0 commit comments