Skip to content

Commit

Permalink
Fix issue where rejectUnauthorized would default to false instead of …
Browse files Browse the repository at this point in the history
…true
  • Loading branch information
mjwwit committed Apr 19, 2021
1 parent ae38832 commit bf53329
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/XMLHttpRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ function XMLHttpRequest(opts) {
options.cert = opts.cert;
options.ca = opts.ca;
options.ciphers = opts.ciphers;
options.rejectUnauthorized = opts.rejectUnauthorized;
options.rejectUnauthorized = opts.rejectUnauthorized === false ? false : true;
}

// Reset error flag
Expand Down Expand Up @@ -442,7 +442,7 @@ function XMLHttpRequest(opts) {
newOptions.cert = opts.cert;
newOptions.ca = opts.ca;
newOptions.ciphers = opts.ciphers;
newOptions.rejectUnauthorized = opts.rejectUnauthorized;
newOptions.rejectUnauthorized = opts.rejectUnauthorized === false ? false : true;
}

// Issue the new request
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "xmlhttprequest-ssl",
"description": "XMLHttpRequest for Node",
"version": "1.6.0",
"version": "1.6.1",
"author": {
"name": "Michael de Wit"
},
Expand Down

0 comments on commit bf53329

Please sign in to comment.