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 @@ -299,7 +299,7 @@ class Http2ServerResponse extends Stream {
299
299
300
300
get headersSent ( ) {
301
301
const stream = this [ kStream ] ;
302
- return stream . headersSent ;
302
+ return stream !== undefined ? stream . headersSent : this [ kState ] . headersSent ;
303
303
}
304
304
305
305
get sendDate ( ) {
@@ -526,6 +526,7 @@ class Http2ServerResponse extends Stream {
526
526
if ( code !== undefined )
527
527
state . closedCode = code ;
528
528
state . closed = true ;
529
+ state . headersSent = this [ kStream ] . headersSent ;
529
530
this . end ( ) ;
530
531
this [ kStream ] = undefined ;
531
532
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