Ver código fonte

Fixes #2048 refs to process outside of env/node

main
Eric Amodio 2 anos atrás
pai
commit
31b973ec17
1 arquivos alterados com 2 adições e 11 exclusões
  1. +2
    -11
      src/plus/gitlab/gitlab.ts

+ 2
- 11
src/plus/gitlab/gitlab.ts Ver arquivo

@ -729,15 +729,10 @@ $search: String!
const agent = this.getProxyAgent(provider);
const ignoreSSLErrors = this.getIgnoreSSLErrors(provider);
let previousRejectUnauthorized;
const fetchMethod: FetchLike = ignoreSSLErrors === 'force' ? insecureFetch : fetch;
try {
if (ignoreSSLErrors === 'force') {
previousRejectUnauthorized = process.env.NODE_TLS_REJECT_UNAUTHORIZED;
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
}
rsp = await fetch(url, {
rsp = await fetchMethod(url, {
headers: { authorization: `Bearer ${token}`, 'content-type': 'application/json' },
agent: agent as any,
...options,
@ -750,10 +745,6 @@ $search: String!
throw new ProviderFetchError('GitLab', rsp);
} finally {
if (ignoreSSLErrors === 'force') {
process.env.NODE_TLS_REJECT_UNAUTHORIZED = previousRejectUnauthorized;
}
stopwatch?.stop();
}
} catch (ex) {

Carregando…
Cancelar
Salvar