From bf53329b61ca6afc5d28f6b8d2dc2e3ca740a9b2 Mon Sep 17 00:00:00 2001 From: Michael de Wit Date: Mon, 19 Apr 2021 12:21:05 +0200 Subject: [PATCH] Fix issue where rejectUnauthorized would default to false instead of true --- lib/XMLHttpRequest.js | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/XMLHttpRequest.js b/lib/XMLHttpRequest.js index 2814f5d..3c23907 100644 --- a/lib/XMLHttpRequest.js +++ b/lib/XMLHttpRequest.js @@ -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 @@ -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 diff --git a/package.json b/package.json index a6c8bc4..235564a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "xmlhttprequest-ssl", "description": "XMLHttpRequest for Node", - "version": "1.6.0", + "version": "1.6.1", "author": { "name": "Michael de Wit" },