Skip to content

Commit 8243ca0

Browse files
committed
http: reuse existing StorageObject
PR-URL: #10941 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
1 parent b377034 commit 8243ca0

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

lib/_http_outgoing.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ var RE_FIELDS = new RegExp('^(?:Connection|Transfer-Encoding|Content-Length|' +
2020
var RE_CONN_VALUES = /(?:^|\W)close|upgrade(?:$|\W)/ig;
2121
var RE_TE_CHUNKED = common.chunkExpression;
2222

23-
// Used to store headers returned by getHeaders()
24-
function OutgoingHeaders() {}
25-
OutgoingHeaders.prototype = Object.create(null);
26-
2723
var dateCache;
2824
function utcDate() {
2925
if (!dateCache) {
@@ -510,7 +506,7 @@ OutgoingMessage.prototype.getHeaderNames = function getHeaderNames() {
510506
// Returns a shallow copy of the current outgoing headers.
511507
OutgoingMessage.prototype.getHeaders = function getHeaders() {
512508
const headers = this[outHeadersKey];
513-
const ret = new OutgoingHeaders();
509+
const ret = new StorageObject();
514510
if (headers) {
515511
const keys = Object.keys(headers);
516512
for (var i = 0; i < keys.length; ++i) {

0 commit comments

Comments
 (0)