From f79367f12c049f33fb763f05ae2ceb1d087d4ab0 Mon Sep 17 00:00:00 2001 From: ycjcl868 <45808948@qq.com> Date: Tue, 1 Jun 2021 09:56:57 +0800 Subject: [PATCH 1/2] test: http outgoing _headers setter null --- test/parallel/test-http-outgoing-internal-headers.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/parallel/test-http-outgoing-internal-headers.js b/test/parallel/test-http-outgoing-internal-headers.js index 7bd97bcb530955..516acbd5759523 100644 --- a/test/parallel/test-http-outgoing-internal-headers.js +++ b/test/parallel/test-http-outgoing-internal-headers.js @@ -31,3 +31,14 @@ common.expectWarning('DeprecationWarning', warn, 'DEP0066'); origin: ['Origin', 'localhost'] })); } + +{ + // Tests for _headers set method `null` + const outgoingMessage = new OutgoingMessage(); + outgoingMessage._headers = null; + + assert.strictEqual( + outgoingMessage[kOutHeaders], + null + ) +} From 3554d3cac2e3010da90b9ee37a85d6ea5b302d35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BF=A1=E9=91=AB-King?= Date: Tue, 1 Jun 2021 10:48:24 +0800 Subject: [PATCH 2/2] Update test/parallel/test-http-outgoing-internal-headers.js Co-authored-by: Qingyu Deng --- test/parallel/test-http-outgoing-internal-headers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-http-outgoing-internal-headers.js b/test/parallel/test-http-outgoing-internal-headers.js index 516acbd5759523..17de5e7d075ce5 100644 --- a/test/parallel/test-http-outgoing-internal-headers.js +++ b/test/parallel/test-http-outgoing-internal-headers.js @@ -40,5 +40,5 @@ common.expectWarning('DeprecationWarning', warn, 'DEP0066'); assert.strictEqual( outgoingMessage[kOutHeaders], null - ) + ); }