feat: Add configurable proxy for outgoing traffic to prevent SSRF

This commit is contained in:
Maksim Eltyshev
2026-02-09 13:33:27 +01:00
parent aa3ebd5add
commit 538280d197
12 changed files with 174 additions and 8 deletions
@@ -4,6 +4,7 @@
*/
const { URL } = require('url');
const { ProxyAgent } = require('undici');
const icoToPng = require('ico-to-png');
const sharp = require('sharp');
@@ -20,6 +21,9 @@ const fetchWithTimeout = (url) => {
return fetch(url, {
signal: abortController.signal,
dispatcher: sails.config.custom.outgoingProxy
? new ProxyAgent(sails.config.custom.outgoingProxy)
: undefined,
});
};