Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Commit 10e144c

Browse files
Updated serviceBase.js to fix the HTTPS_PROXY (#899)
Changed the temporary variable name to nodeFetch because the global.fetch wasn't overwriting the variable. This should fix issue 887: #887 Co-authored-by: Emilio Munoz <[email protected]>
1 parent f97e0cb commit 10e144c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/qnamaker/utils/api/serviceBase.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ const { insertParametersFromObject } = require('../insertParametersFromObject');
77
const deriveParamsFromPath = require('../deriveParamsFromPath');
88
const packageJSON = require('./../../package');
99

10-
const fetch = require('node-fetch');
10+
const nodeFetch = require('node-fetch');
1111

1212
global.fetch = function (...args) {
1313
// No Proxy
1414
if (!process.env.HTTPS_PROXY) {
15-
return fetch(...args);
15+
return nodeFetch(...args);
1616
}
1717
const [urlOrRequest, requestInit = {}, ...rest] = args;
1818
// URL is first param attach the proxy
@@ -24,7 +24,7 @@ global.fetch = function (...args) {
2424
} else {
2525
urlOrRequest.agent = agent;
2626
}
27-
return fetch(urlOrRequest, requestInit, ...rest);
27+
return nodeFetch(urlOrRequest, requestInit, ...rest);
2828
};
2929

3030
/**

0 commit comments

Comments
 (0)