Skip to content

Commit 3818313

Browse files
committed
fix: handle undefined protocol in makeProxyAgent
1 parent 4a38e50 commit 3818313

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils/makeProxyAgent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export function makeProxyAgentUndici(proxy: Proxy | string): ProxyAgent {
5555
proxyUrl = proxy
5656
} else {
5757
const { host, password, port, protocol: proto, username } = proxy
58-
protocol = proto.replace(':', '')
58+
protocol = (proto || 'http').replace(':', '')
5959

6060
if (protocol === 'socks') {
6161
protocol = 'socks5'

0 commit comments

Comments
 (0)