We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0f52b41 commit 86e55efCopy full SHA for 86e55ef
test/parallel/test-http-outgoing-internal-headers.js
@@ -0,0 +1,28 @@
1
+// Flags: --expose-internals
2
+'use strict';
3
+const common = require('../common');
4
+const assert = require('assert');
5
+
6
+const { outHeadersKey } = require('internal/http');
7
+const { OutgoingMessage } = require('http');
8
9
+{
10
+ // tests for _headers get method
11
+ const outgoingMessage = new OutgoingMessage();
12
+ outgoingMessage.getHeaders = common.mustCall();
13
+ outgoingMessage._headers;
14
+}
15
16
17
+ // tests for _headers set method
18
19
+ outgoingMessage._headers = {
20
+ host: 'risingstack.com',
21
+ Origin: 'localhost'
22
+ };
23
24
+ assert.deepStrictEqual(outgoingMessage[outHeadersKey], {
25
+ host: ['host', 'risingstack.com'],
26
+ origin: ['Origin', 'localhost']
27
+ });
28
0 commit comments