fix: handle undefined protocol in makeProxyAgent

This commit is contained in:
Jeferson Ramos 2025-10-27 10:40:10 -03:00
parent 4a38e505f4
commit 3818313161

View File

@ -55,7 +55,7 @@ export function makeProxyAgentUndici(proxy: Proxy | string): ProxyAgent {
proxyUrl = proxy
} else {
const { host, password, port, protocol: proto, username } = proxy
protocol = proto.replace(':', '')
protocol = (proto || 'http').replace(':', '')
if (protocol === 'socks') {
protocol = 'socks5'