diff options
author | Andrei Zeliankou <zelenkov@nginx.com> | 2023-11-17 17:27:31 +0000 |
---|---|---|
committer | Andrei Zeliankou <zelenkov@nginx.com> | 2023-11-17 17:27:31 +0000 |
commit | 1443d623d4b5d59e4463e025b4125be9a5aa3436 (patch) | |
tree | 72207d13dd32510cb40f6586b840921d0bc14bf8 /test | |
parent | 919cae7ff95a3ce5878731a8d23f34c75489d3b4 (diff) | |
download | unit-1443d623d4b5d59e4463e025b4125be9a5aa3436.tar.gz unit-1443d623d4b5d59e4463e025b4125be9a5aa3436.tar.bz2 |
Node.js: ServerResponse.flushHeaders() implemented.
This closes #1006 issue on GitHub.
Reviewed-by: Andrew Clayton <a.clayton@nginx.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/node/flush_headers/app.js | 7 | ||||
-rw-r--r-- | test/test_node_application.py | 4 |
2 files changed, 11 insertions, 0 deletions
diff --git a/test/node/flush_headers/app.js b/test/node/flush_headers/app.js new file mode 100644 index 00000000..4c0e93bc --- /dev/null +++ b/test/node/flush_headers/app.js @@ -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); diff --git a/test/test_node_application.py b/test/test_node_application.py index ab8aa8f8..5077b9cb 100644 --- a/test/test_node_application.py +++ b/test/test_node_application.py @@ -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') |