File tree Expand file tree Collapse file tree 2 files changed +17
-8
lines changed Expand file tree Collapse file tree 2 files changed +17
-8
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @agility/content-fetch" ,
3- "version" : " 1.0.1 " ,
3+ "version" : " 1.0.2 " ,
44 "description" : " JavaScript library for the Agility Fetch API (node and browser)" ,
55 "main" : " dist/agility-content-fetch.node.js" ,
66 "scripts" : {
Original file line number Diff line number Diff line change @@ -105,13 +105,22 @@ export default function createClient(userConfig) {
105105
106106 const https = require ( "https" )
107107
108- //create apply the adapter to our axios instance
109- const api = axios . create ( {
110- httpsAgent : new https . Agent ( {
111- rejectUnauthorized : false
112- } ) ,
113- adapter : adapter ,
114- } )
108+ let api = null ;
109+
110+ if ( https . Agent ) {
111+ //create apply the adapter to our axios instance
112+ api = axios . create ( {
113+ httpsAgent : new https . Agent ( {
114+ rejectUnauthorized : false
115+ } ) ,
116+ adapter : adapter ,
117+ } )
118+ } else {
119+ //we can't use the https.Agent
120+ api = axios . create ( {
121+ adapter : adapter ,
122+ } )
123+ }
115124
116125
117126
You can’t perform that action at this time.
0 commit comments