mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 13:48:44 +02:00

PR-URL: https://github.com/nodejs/node/pull/59060 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: Tim Perry <pimterry@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
20 lines
679 B
JavaScript
20 lines
679 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const http = require('http');
|
|
|
|
common.expectWarning('DeprecationWarning',
|
|
'ServerResponse.prototype.writeHeader is deprecated.', 'DEP0063');
|
|
|
|
const server = http.createServer(common.mustCall((req, res) => {
|
|
res.writeHeader(200, [ 'test', '2', 'test2', '2' ]);
|
|
res.end();
|
|
})).listen(0, common.mustCall(() => {
|
|
http.get({ port: server.address().port }, common.mustCall((res) => {
|
|
assert.strictEqual(res.headers.test, '2');
|
|
assert.strictEqual(res.headers.test2, '2');
|
|
res.resume().on('end', common.mustCall(() => {
|
|
server.close();
|
|
}));
|
|
}));
|
|
}));
|