File tree Expand file tree Collapse file tree 4 files changed +22
-0
lines changed Expand file tree Collapse file tree 4 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,13 @@ can be used as a unique request identifier.
33
33
</para >
34
34
</change >
35
35
36
+ <change type =" feature" >
37
+ <para >
38
+ ServerRequest.flushHeaders() implemented in Node.js module to make it compatible
39
+ with Next.js.
40
+ </para >
41
+ </change >
42
+
36
43
</changes >
37
44
38
45
Original file line number Diff line number Diff line change @@ -138,6 +138,10 @@ ServerResponse.prototype.removeHeader = function removeHeader(name) {
138
138
}
139
139
} ;
140
140
141
+ ServerResponse . prototype . flushHeaders = function flushHeaders ( ) {
142
+ this . _sendHeaders ( ) ;
143
+ } ;
144
+
141
145
ServerResponse . prototype . _removeHeader = function _removeHeader ( lc_name ) {
142
146
let entry = this . headers [ lc_name ] ;
143
147
let name_len = Buffer . byteLength ( entry [ 0 ] + "" , 'latin1' ) ;
Original file line number Diff line number Diff line change
1
+
2
+ require ( 'http' ) . createServer ( function ( req , res ) {
3
+ res . setHeader ( 'X-Header' , 'blah' ) ;
4
+ res . flushHeaders ( ) ;
5
+ res . flushHeaders ( ) ; // Should be idempotent.
6
+ res . end ( ) ;
7
+ } ) . listen ( 8080 ) ;
Original file line number Diff line number Diff line change @@ -303,6 +303,10 @@ def test_node_application_get_header_names():
303
303
'x-header' ,
304
304
], 'get header names'
305
305
306
+ def test_node_application_flush_headers ():
307
+ client .load ('flush_headers' )
308
+
309
+ assert client .get ()['headers' ]['X-Header' ] == 'blah'
306
310
307
311
def test_node_application_has_header ():
308
312
client .load ('has_header' )
You can’t perform that action at this time.
0 commit comments