Skip to content

Commit d7a29ee

Browse files
committed
refactor proxy type condition
1 parent 511662e commit d7a29ee

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,13 +255,13 @@ export class KubeConfig implements SecurityAuthentication {
255255
if (cluster && cluster.proxyUrl) {
256256
if (cluster.proxyUrl.startsWith('socks')) {
257257
agent = new SocksProxyAgent(cluster.proxyUrl, agentOptions);
258-
} else if (cluster.proxyUrl.startsWith('http')) {
259-
agent = new HttpsProxyAgent({
258+
} else if (cluster.server.startsWith('http')) {
259+
agent = new HttpProxyAgent({
260260
proxy: cluster.proxyUrl,
261261
...agentOptions,
262262
});
263-
} else if (cluster.proxyUrl.startsWith('https')) {
264-
agent = new HttpProxyAgent({
263+
} else if (cluster.server.startsWith('https')) {
264+
agent = new HttpsProxyAgent({
265265
proxy: cluster.proxyUrl,
266266
...agentOptions,
267267
});

0 commit comments

Comments
 (0)