mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
6a84f1c403
This reverts commit 4d723c7fd6
.
I'm not sure if we should re-apply this as a semver-major change or if
we should accept it as valid and add tests/documentation, but either
way, we have to revert it at least temporarily.
Closes: https://github.com/nodejs/node/issues/45510
PR-URL: https://github.com/nodejs/node/pull/45527
Fixes: https://github.com/nodejs/node/issues/45510
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
28 lines
725 B
JavaScript
28 lines
725 B
JavaScript
'use strict';
|
|
|
|
require('../common');
|
|
const { IncomingMessage } = require('http');
|
|
const assert = require('assert');
|
|
|
|
// Headers setter function set a header correctly
|
|
{
|
|
const im = new IncomingMessage();
|
|
im.headers = { key: 'value' };
|
|
assert.deepStrictEqual(im.headers, { key: 'value' });
|
|
}
|
|
|
|
// Trailers setter function set a header correctly
|
|
{
|
|
const im = new IncomingMessage();
|
|
im.trailers = { key: 'value' };
|
|
assert.deepStrictEqual(im.trailers, { key: 'value' });
|
|
}
|
|
|
|
// _addHeaderLines function set a header correctly
|
|
{
|
|
const im = new IncomingMessage();
|
|
im.headers = { key1: 'value1' };
|
|
im._addHeaderLines(['key2', 'value2'], 2);
|
|
assert.deepStrictEqual(im.headers, { key1: 'value1', key2: 'value2' });
|
|
}
|