File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -320,7 +320,7 @@ class Http2ServerResponse extends Stream {
320320
321321 get headersSent ( ) {
322322 const stream = this [ kStream ] ;
323- return stream . headersSent ;
323+ return stream !== undefined ? stream . headersSent : this [ kState ] . headersSent ;
324324 }
325325
326326 get sendDate ( ) {
@@ -542,6 +542,7 @@ class Http2ServerResponse extends Stream {
542542 if ( code !== undefined )
543543 state . closedCode = code ;
544544 state . closed = true ;
545+ state . headersSent = this [ kStream ] . headersSent ;
545546 this . end ( ) ;
546547 this [ kStream ] = undefined ;
547548 this . emit ( 'finish' ) ;
Original file line number Diff line number Diff line change @@ -88,6 +88,7 @@ server.listen(0, common.mustCall(function() {
8888
8989 response . on ( 'finish' , common . mustCall ( function ( ) {
9090 assert . strictEqual ( response . code , h2 . constants . NGHTTP2_NO_ERROR ) ;
91+ assert . strictEqual ( response . headersSent , true ) ;
9192 server . close ( ) ;
9293 } ) ) ;
9394 response . end ( ) ;
You can’t perform that action at this time.
0 commit comments