Skip to content

Commit

Permalink
fix: (strf-8840) add missing rejectUnauthorized parameter to the API …
Browse files Browse the repository at this point in the history
…requests
  • Loading branch information
MaxGenash committed Dec 4, 2020
1 parent 946a012 commit 5ee6138
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/utils/networkUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@
* @module Contains helpers functions for working with network requests
*/

const fetch = require('node-fetch');
const https = require('https');
const fs = require('fs');
const axios = require('axios');

/**
/** Used to send request to our (Bigcommerce) servers only.
* Shouldn't be used to send requests to third party servers because we disable https checks
*
* @param {object} options
* @returns {Promise<object>}
*/
async function sendApiRequest(options) {
return axios(options);
return axios({
httpsAgent: new https.Agent({ rejectUnauthorized: false }),
...options,
});
}

/**
Expand Down

0 comments on commit 5ee6138

Please sign in to comment.