File tree Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -648,7 +648,7 @@ class Http2ServerResponse extends Stream {
648648
649649 if ( ( state . closed || state . ending ) &&
650650 state . headRequest === stream . headRequest ) {
651- return false ;
651+ return this ;
652652 }
653653
654654 if ( typeof chunk === 'function' ) {
Original file line number Diff line number Diff line change @@ -60,6 +60,34 @@ const {
6060 } ) ) ;
6161}
6262
63+ {
64+ // Http2ServerResponse.end should return self after end
65+ const server = createServer ( mustCall ( ( request , response ) => {
66+ strictEqual ( response , response . end ( ) ) ;
67+ strictEqual ( response , response . end ( ) ) ;
68+ server . close ( ) ;
69+ } ) ) ;
70+ server . listen ( 0 , mustCall ( ( ) => {
71+ const { port } = server . address ( ) ;
72+ const url = `http://localhost:${ port } ` ;
73+ const client = connect ( url , mustCall ( ( ) => {
74+ const headers = {
75+ ':path' : '/' ,
76+ ':method' : 'GET' ,
77+ ':scheme' : 'http' ,
78+ ':authority' : `localhost:${ port } `
79+ } ;
80+ const request = client . request ( headers ) ;
81+ request . setEncoding ( 'utf8' ) ;
82+ request . on ( 'end' , mustCall ( ( ) => {
83+ client . close ( ) ;
84+ } ) ) ;
85+ request . end ( ) ;
86+ request . resume ( ) ;
87+ } ) ) ;
88+ } ) ) ;
89+ }
90+
6391{
6492 // Http2ServerResponse.end can omit encoding arg, sets it to utf-8
6593 const server = createServer ( mustCall ( ( request , response ) => {
You can’t perform that action at this time.
0 commit comments