diff --git a/api/strategies/openidStrategy.js b/api/strategies/openidStrategy.js index 794a38778d..2beeaa13eb 100644 --- a/api/strategies/openidStrategy.js +++ b/api/strategies/openidStrategy.js @@ -25,12 +25,18 @@ const downloadImage = async (url, accessToken) => { } try { - const response = await fetch(url, { + const options = { method: 'GET', headers: { Authorization: `Bearer ${accessToken}`, }, - }); + }; + + if (process.env.PROXY) { + options.agent = new HttpsProxyAgent(process.env.PROXY); + } + + const response = await fetch(url, options); if (response.ok) { const buffer = await response.buffer();