Skip to content

Commit

Permalink
http: reuse existing StorageObject
Browse files Browse the repository at this point in the history
PR-URL: #10941
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
  • Loading branch information
mscdex committed Mar 9, 2017
1 parent b377034 commit 8243ca0
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/_http_outgoing.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ var RE_FIELDS = new RegExp('^(?:Connection|Transfer-Encoding|Content-Length|' +
var RE_CONN_VALUES = /(?:^|\W)close|upgrade(?:$|\W)/ig;
var RE_TE_CHUNKED = common.chunkExpression;

// Used to store headers returned by getHeaders()
function OutgoingHeaders() {}
OutgoingHeaders.prototype = Object.create(null);

var dateCache;
function utcDate() {
if (!dateCache) {
Expand Down Expand Up @@ -510,7 +506,7 @@ OutgoingMessage.prototype.getHeaderNames = function getHeaderNames() {
// Returns a shallow copy of the current outgoing headers.
OutgoingMessage.prototype.getHeaders = function getHeaders() {
const headers = this[outHeadersKey];
const ret = new OutgoingHeaders();
const ret = new StorageObject();
if (headers) {
const keys = Object.keys(headers);
for (var i = 0; i < keys.length; ++i) {
Expand Down

0 comments on commit 8243ca0

Please sign in to comment.