diff --git a/src/vs/code/electron-main/window.ts b/src/vs/code/electron-main/window.ts index e8116b8899d..78095162798 100644 --- a/src/vs/code/electron-main/window.ts +++ b/src/vs/code/electron-main/window.ts @@ -601,9 +601,12 @@ export class CodeWindow extends Disposable implements ICodeWindow { } // Do not set to empty configuration at startup if setting is empty to not override configuration through CLI options: const env = process.env; - const newHttpProxy = (this.configurationService.getValue('http.proxy') || '').trim() + let newHttpProxy = (this.configurationService.getValue('http.proxy') || '').trim() || (env.https_proxy || process.env.HTTPS_PROXY || process.env.http_proxy || process.env.HTTP_PROXY || '').trim() // Not standardized. || undefined; + if (newHttpProxy?.endsWith('/')) { + newHttpProxy = newHttpProxy.substr(0, newHttpProxy.length - 1); + } const newNoProxy = (env.no_proxy || env.NO_PROXY || '').trim() || undefined; // Not standardized. if ((newHttpProxy || '').indexOf('@') === -1 && (newHttpProxy !== this.currentHttpProxy || newNoProxy !== this.currentNoProxy)) { this.currentHttpProxy = newHttpProxy;