Skip to content

Commit c02da2d

Browse files
committed
Fixes #2048 refs to process outside of env/node
1 parent 0f1cea8 commit c02da2d

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

src/plus/gitlab/gitlab.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -729,15 +729,10 @@ $search: String!
729729

730730
const agent = this.getProxyAgent(provider);
731731
const ignoreSSLErrors = this.getIgnoreSSLErrors(provider);
732-
let previousRejectUnauthorized;
732+
const fetchMethod: FetchLike = ignoreSSLErrors === 'force' ? insecureFetch : fetch;
733733

734734
try {
735-
if (ignoreSSLErrors === 'force') {
736-
previousRejectUnauthorized = process.env.NODE_TLS_REJECT_UNAUTHORIZED;
737-
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
738-
}
739-
740-
rsp = await fetch(url, {
735+
rsp = await fetchMethod(url, {
741736
headers: { authorization: `Bearer ${token}`, 'content-type': 'application/json' },
742737
agent: agent as any,
743738
...options,
@@ -750,10 +745,6 @@ $search: String!
750745

751746
throw new ProviderFetchError('GitLab', rsp);
752747
} finally {
753-
if (ignoreSSLErrors === 'force') {
754-
process.env.NODE_TLS_REJECT_UNAUTHORIZED = previousRejectUnauthorized;
755-
}
756-
757748
stopwatch?.stop();
758749
}
759750
} catch (ex) {

0 commit comments

Comments
 (0)