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 <rtrott@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent eb369f6 commit 65cda7f

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎lib/_http_server.js‎

Lines changed: 1 addition & 1 deletion
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‎

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

547547
TLSSocket.prototype.setMaxSendFragment=functionsetMaxSendFragment(size){
548-
returnthis._handle.setMaxSendFragment(size)==1;
548+
returnthis._handle.setMaxSendFragment(size)===1;
549549
};
550550

551551
TLSSocket.prototype.getTLSTicket=functiongetTLSTicket(){

0 commit comments

Comments
 (0)