Skip to content

Commit c30395b

Browse files
authoredApr 20, 2022
feat: handling missing process global
#337 This improves compatibility with blunders that don't implement hacks like Vite, as well as non Node.js JavaScript environments such as Browsers, Deno, v8js and WebContainers.
1 parent a926962 commit c30395b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎src/gaxios.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ let HttpsProxyAgent: any;
6363

6464
function loadProxy() {
6565
const proxy =
66-
process.env.HTTPS_PROXY ||
67-
process.env.https_proxy ||
68-
process.env.HTTP_PROXY ||
69-
process.env.http_proxy;
66+
process?.env?.HTTPS_PROXY ||
67+
process?.env?.https_proxy ||
68+
process?.env?.HTTP_PROXY ||
69+
process?.env?.http_proxy;
7070
if (proxy) {
7171
HttpsProxyAgent = require('https-proxy-agent');
7272
}

0 commit comments

Comments
 (0)
Please sign in to comment.