caccl-send-request
Advanced tools
Comparing version 1.0.1 to 1.0.2
14
index.js
const axios = require('axios'); | ||
const qs = require('qs'); | ||
const CACCLError = require('caccl-error'); | ||
const https = require('https'); | ||
const errorCodes = require('./errorCodes'); | ||
// Create an agent to ignore unauthorize ssl issues | ||
const ignoreSSLIssuesAgent = new https.Agent({ rejectUnauthorized: false }); | ||
/** | ||
@@ -16,2 +20,4 @@ * Sends and retries an http request | ||
* fails | ||
* @param {boolean} [ignoreSSLIssues=false] - if true, ignores SSL certificate | ||
* issues | ||
* @return {Promise.<CACCLErrror|object>} Returns { body, status, headers } on | ||
@@ -46,2 +52,9 @@ * success, CACCLError on failure | ||
// Prep to ignore ssl issues | ||
const httpsAgent = ( | ||
options.ignoreSSLIssues | ||
? ignoreSSLIssuesAgent | ||
: undefined | ||
); | ||
// Send request | ||
@@ -52,2 +65,3 @@ return axios({ | ||
data, | ||
httpsAgent, | ||
headers: { | ||
@@ -54,0 +68,0 @@ 'Content-Type': 'application/x-www-form-urlencoded', |
{ | ||
"name": "caccl-send-request", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "The default request sender used throughout the CACCL project.", | ||
@@ -37,4 +37,5 @@ "main": "index.js", | ||
"caccl-error": "^1.0.0", | ||
"https": "^1.0.0", | ||
"qs": "^6.5.2" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5534
150
4
1
+ Addedhttps@^1.0.0
+ Addedhttps@1.0.0(transitive)