Merge pull request #2745 from QwenLM/fix/proxy-url-compability
Some checks are pending
Qwen Code CI / Lint (push) Waiting to run
Qwen Code CI / Test (push) Blocked by required conditions
Qwen Code CI / Test-1 (push) Blocked by required conditions
Qwen Code CI / Test-2 (push) Blocked by required conditions
Qwen Code CI / Test-3 (push) Blocked by required conditions
Qwen Code CI / Test-4 (push) Blocked by required conditions
Qwen Code CI / Test-5 (push) Blocked by required conditions
Qwen Code CI / Test-6 (push) Blocked by required conditions
Qwen Code CI / Test-7 (push) Blocked by required conditions
Qwen Code CI / Test-8 (push) Blocked by required conditions
Qwen Code CI / Post Coverage Comment (push) Blocked by required conditions
Qwen Code CI / CodeQL (push) Waiting to run
E2E Tests / E2E Test (Linux) - sandbox:docker (push) Waiting to run
E2E Tests / E2E Test (Linux) - sandbox:none (push) Waiting to run
E2E Tests / E2E Test - macOS (push) Waiting to run

fix: normalize proxy URLs to support addresses without protocol prefix
This commit is contained in:
DennisYu07 2026-04-01 14:30:29 +08:00 committed by GitHub
commit 4b05c74b02
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 164 additions and 3 deletions

View file

@ -108,6 +108,7 @@ import { shouldDefaultToNodePty } from '../utils/shell-utils.js';
import { WorkspaceContext } from '../utils/workspaceContext.js';
import { type ToolName } from '../utils/tool-utils.js';
import { getErrorMessage } from '../utils/errors.js';
import { normalizeProxyUrl } from '../utils/proxyUtils.js';
// Local config modules
import type { FileFilteringOptions } from './constants.js';
@ -747,8 +748,9 @@ export class Config {
initializeTelemetry(this);
}
if (this.getProxy()) {
setGlobalDispatcher(new ProxyAgent(this.getProxy() as string));
const proxyUrl = this.getProxy();
if (proxyUrl) {
setGlobalDispatcher(new ProxyAgent(proxyUrl));
}
this.geminiClient = new GeminiClient(this);
this.chatRecordingService = this.chatRecordingEnabled
@ -1717,7 +1719,7 @@ export class Config {
}
getProxy(): string | undefined {
return this.proxy;
return normalizeProxyUrl(this.proxy);
}
getWorkingDir(): string {