From bc57709e20eef4ae575ccdb58551bac31ec2ccdb 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 Minor fix to favor strict equality in http_server.js and tls_wrap.js to ensure accurate comparisons without type coercion. --- 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() {