File tree 2 files changed +3
-1
lines changed
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 {
320
320
321
321
get headersSent ( ) {
322
322
const stream = this [ kStream ] ;
323
- return stream . headersSent ;
323
+ return stream !== undefined ? stream . headersSent : this [ kState ] . headersSent ;
324
324
}
325
325
326
326
get sendDate ( ) {
@@ -542,6 +542,7 @@ class Http2ServerResponse extends Stream {
542
542
if ( code !== undefined )
543
543
state . closedCode = code ;
544
544
state . closed = true ;
545
+ state . headersSent = this [ kStream ] . headersSent ;
545
546
this . end ( ) ;
546
547
this [ kStream ] = undefined ;
547
548
this . emit ( 'finish' ) ;
Original file line number Diff line number Diff line change @@ -88,6 +88,7 @@ server.listen(0, common.mustCall(function() {
88
88
89
89
response . on ( 'finish' , common . mustCall ( function ( ) {
90
90
assert . strictEqual ( response . code , h2 . constants . NGHTTP2_NO_ERROR ) ;
91
+ assert . strictEqual ( response . headersSent , true ) ;
91
92
server . close ( ) ;
92
93
} ) ) ;
93
94
response . end ( ) ;
You can’t perform that action at this time.
0 commit comments