Remove trailing slash (fixes #97885)

This commit is contained in:
Christof Marti
2020-05-27 22:39:14 +02:00
parent 8eef8425ab
commit be5a16bf9c

View File

@@ -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<string>('http.proxy') || '').trim()
let newHttpProxy = (this.configurationService.getValue<string>('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;