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 2
2
" @opennextjs/aws " : patch
3
3
---
4
4
5
- fix(dev-overrides) : Add automatic response cleanup via onClose callback
5
+ fix: Add automatic response cleanup via AbortSignal
6
6
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 {
85
85
this . statusCode = statusCode ;
86
86
}
87
87
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)
89
89
// This is to support `request.signal.onabort` in route handlers
90
- if ( streamCreator ?. abortSignal ) {
91
- streamCreator . abortSignal . addEventListener ( "abort" , ( ) => {
90
+ streamCreator ?. abortSignal ?. addEventListener ( "abort" , ( ) => {
92
91
this . destroy ( ) ;
93
- } ) ;
94
- }
92
+ } ) ;
95
93
}
96
94
97
95
// Necessary for next 12
You can’t perform that action at this time.
0 commit comments