From 65cda7f265126bbb59e55e486c4476147322ebf0 Mon Sep 17 00:00:00 2001 From: Walter Beller-Morales Date: Tue, 29 Nov 2016 17:58:05 -0600 Subject: [PATCH] lib: use === in _http_server and _tls_wrap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Minor fix to favor strict equality in http_server.js and tls_wrap.js to ensure accurate comparisons without type coercion. PR-URL: https://github.com/nodejs/node/pull/9849 Reviewed-By: Rich Trott Reviewed-By: Michael Dawson Reviewed-By: Colin Ihrig Reviewed-By: Michaƫl Zasso Reviewed-By: Luigi Pinca --- lib/_http_server.js | 2 +- lib/_tls_wrap.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/_http_server.js b/lib/_http_server.js index 99671832ebb2cb..c5f92d52d54d9b 100644 --- a/lib/_http_server.js +++ b/lib/_http_server.js @@ -525,7 +525,7 @@ function connectionListener(socket) { } if (req.headers.expect !== undefined && - (req.httpVersionMajor == 1 && req.httpVersionMinor == 1)) { + (req.httpVersionMajor === 1 && req.httpVersionMinor === 1)) { if (continueExpression.test(req.headers.expect)) { res._expect_continue = true; diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js index cd793cb34f0a54..d9dafceb950dc7 100644 --- a/lib/_tls_wrap.js +++ b/lib/_tls_wrap.js @@ -545,7 +545,7 @@ TLSSocket.prototype.renegotiate = function(options, callback) { }; TLSSocket.prototype.setMaxSendFragment = function setMaxSendFragment(size) { - return this._handle.setMaxSendFragment(size) == 1; + return this._handle.setMaxSendFragment(size) === 1; }; TLSSocket.prototype.getTLSTicket = function getTLSTicket() {