File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
server/core/src/adapters/node
toolkit/runtime-utils/src/node Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ const handleResponseError = (e: unknown, res: NodeResponse) => {
145145 ) as Error & {
146146 code : string ;
147147 } ;
148- if ( err . code === 'ERR_STREAM_PREMATURE_CLOSE' ) {
148+ if ( err . code === 'ABORT_ERR' || err . code === ' ERR_STREAM_PREMATURE_CLOSE') {
149149 console . info ( 'The user aborted a request.' ) ;
150150 } else {
151151 console . error ( e ) ;
Original file line number Diff line number Diff line change @@ -63,10 +63,12 @@ class StreamPump {
6363 this . stream . destroy ( reason ) ;
6464 }
6565
66- this . stream . off ( 'data' , this . enqueue ) ;
67- this . stream . off ( 'error' , this . error ) ;
68- this . stream . off ( 'end' , this . close ) ;
69- this . stream . off ( 'close' , this . close ) ;
66+ process . nextTick ( ( ) => {
67+ this . stream . off ( 'data' , this . enqueue ) ;
68+ this . stream . off ( 'error' , this . error ) ;
69+ this . stream . off ( 'end' , this . close ) ;
70+ this . stream . off ( 'close' , this . close ) ;
71+ } ) ;
7072 }
7173
7274 enqueue ( chunk : Uint8Array | string ) {
You can’t perform that action at this time.
0 commit comments