mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
http: use Symbol for outgoing headers
PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
5 files changed
+26
-16
No files matched your search
+3
-2
@@ -13,6 +13,7 @@ const continueExpression = common.continueExpression;
|
||||
const chunkExpression = common.chunkExpression;
|
||||
const httpSocketSetup = common.httpSocketSetup;
|
||||
const OutgoingMessage = require('_http_outgoing').OutgoingMessage;
|
||||
const outHeadersKey = require('internal/http').outHeadersKey;
|
||||
|
||||
const STATUS_CODES = exports.STATUS_CODES = {
|
||||
100: 'Continue',
|
||||
@@ -179,7 +180,7 @@ function writeHead(statusCode, reason, obj) {
|
||||
this.statusCode = statusCode;
|
||||
|
||||
var headers;
|
||||
if (this._headers) {
|
||||
if (this[outHeadersKey]) {
|
||||
// Slow-case: when progressive API and header fields are passed.
|
||||
var k;
|
||||
if (obj) {
|
||||
@@ -196,7 +197,7 @@ function writeHead(statusCode, reason, obj) {
|
||||
}
|
||||
}
|
||||
// only progressive api is used
|
||||
headers = this._headers;
|
||||
headers = this[outHeadersKey];
|
||||
} else {
|
||||
// only writeHead() called
|
||||
headers = obj;
|
||||
|
||||
Reference in new issue
Block a user