diff options
Diffstat (limited to 'lib/_http_server.js')
-rw-r--r-- | lib/_http_server.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/_http_server.js b/lib/_http_server.js index f6cfa3543c..4c7f92d9e3 100644 --- a/lib/_http_server.js +++ b/lib/_http_server.js @@ -173,7 +173,7 @@ ServerResponse.prototype._implicitHeader = function() { ServerResponse.prototype.writeHead = function(statusCode) { var reasonPhrase, headers, headerIndex; - if (typeof arguments[1] == 'string') { + if (IS_STRING(arguments[1])) { reasonPhrase = arguments[1]; headerIndex = 2; } else { @@ -188,13 +188,13 @@ ServerResponse.prototype.writeHead = function(statusCode) { // Slow-case: when progressive API and header fields are passed. headers = this._renderHeaders(); - if (Array.isArray(obj)) { + if (IS_ARRAY(obj)) { // handle array case // TODO: remove when array is no longer accepted var field; for (var i = 0, len = obj.length; i < len; ++i) { field = obj[i][0]; - if (headers[field] !== undefined) { + if (!IS_UNDEFINED(headers[field])) { obj.push([field, headers[field]]); } } @@ -332,7 +332,7 @@ function connectionListener(socket) { parser.incoming = null; // Propagate headers limit from server instance to parser - if (typeof this.maxHeadersCount === 'number') { + if (IS_NUMBER(this.maxHeadersCount)) { parser.maxHeaderPairs = this.maxHeadersCount << 1; } else { // Set default value because parser may be reused from FreeList @@ -442,7 +442,7 @@ function connectionListener(socket) { } }); - if (req.headers.expect !== undefined && + if (!IS_UNDEFINED(req.headers.expect) && (req.httpVersionMajor == 1 && req.httpVersionMinor == 1) && continueExpression.test(req.headers['expect'])) { res._expect_continue = true; |