From 901ab5d11d694212d32e53b97f771c5d601e428e Mon Sep 17 00:00:00 2001 From: sharon Date: Tue, 8 Oct 2024 12:26:47 -0400 Subject: [PATCH] default to HTML file proxy unless uri is http or https (#4939) (#4945) Backports the fix for https://github.com/posit-dev/positron/issues/4930 to the `2024.10` release by cherry-picking the commit from https://github.com/posit-dev/positron/pull/4939. Co-authored-by: sharon wang <25834218+sharon-wang@users.noreply.github.com> --- .../common/languageRuntimeUiClient.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/vs/workbench/services/languageRuntime/common/languageRuntimeUiClient.ts b/src/vs/workbench/services/languageRuntime/common/languageRuntimeUiClient.ts index 9724532b252..17b18ffe506 100644 --- a/src/vs/workbench/services/languageRuntime/common/languageRuntimeUiClient.ts +++ b/src/vs/workbench/services/languageRuntime/common/languageRuntimeUiClient.ts @@ -213,16 +213,18 @@ export class UiClientInstance extends Disposable { const uriScheme = URI.parse(targetPath).scheme; let url; - if (uriScheme === 'file') { - // If the path is for a file, start an HTML proxy server. + if (uriScheme === 'http' || uriScheme === 'https') { + // If the path is for a server, start a generic proxy server. url = await this._commandService.executeCommand( - 'positronProxy.startHtmlProxyServer', + 'positronProxy.startHttpProxyServer', targetPath ); - } else if (uriScheme === 'http' || uriScheme === 'https') { - // If the path is for a server, start a generic proxy server. + } else { + // Assume the path is for a file and start an HTML proxy server. + // The uriScheme could be 'file' in this case, or even 'C' if the path is for an HTML + // file on a Windows machine. url = await this._commandService.executeCommand( - 'positronProxy.startHttpProxyServer', + 'positronProxy.startHtmlProxyServer', targetPath ); }