Node.js: ServerResponse.flushHeaders() implemented.

This closes #1006 issue on GitHub.

Reviewed-by: Andrew Clayton <a.clayton@nginx.com>
This commit is contained in:
Andrei Zeliankou
2023-11-17 17:27:31 +00:00
parent 919cae7ff9
commit 1443d623d4
4 changed files with 22 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
require('http').createServer(function (req, res) {
res.setHeader('X-Header', 'blah');
res.flushHeaders();
res.flushHeaders(); // Should be idempotent.
res.end();
}).listen(8080);

View File

@@ -303,6 +303,10 @@ def test_node_application_get_header_names():
'x-header',
], 'get header names'
def test_node_application_flush_headers():
client.load('flush_headers')
assert client.get()['headers']['X-Header'] == 'blah'
def test_node_application_has_header():
client.load('has_header')