Skip to content

Commit 65cda7f

Browse files
walterbmaddaleax
authored andcommitted
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. PR-URL: #9849 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent eb369f6 commit 65cda7f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/_http_server.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ function connectionListener(socket) {
525525
}
526526

527527
if (req.headers.expect !== undefined &&
528-
(req.httpVersionMajor == 1 && req.httpVersionMinor == 1)) {
528+
(req.httpVersionMajor === 1 && req.httpVersionMinor === 1)) {
529529
if (continueExpression.test(req.headers.expect)) {
530530
res._expect_continue = true;
531531

lib/_tls_wrap.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ TLSSocket.prototype.renegotiate = function(options, callback) {
545545
};
546546

547547
TLSSocket.prototype.setMaxSendFragment = function setMaxSendFragment(size) {
548-
return this._handle.setMaxSendFragment(size) == 1;
548+
return this._handle.setMaxSendFragment(size) === 1;
549549
};
550550

551551
TLSSocket.prototype.getTLSTicket = function getTLSTicket() {

0 commit comments

Comments
 (0)