Skip to content

Commit 901ab5d

Browse files
authored
default to HTML file proxy unless uri is http or https (#4939) (#4945)
Backports the fix for #4930 to the `2024.10` release by cherry-picking the commit from #4939. Co-authored-by: sharon wang <[email protected]>
1 parent 34b5c57 commit 901ab5d

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/vs/workbench/services/languageRuntime/common/languageRuntimeUiClient.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -213,16 +213,18 @@ export class UiClientInstance extends Disposable {
213213
const uriScheme = URI.parse(targetPath).scheme;
214214
let url;
215215

216-
if (uriScheme === 'file') {
217-
// If the path is for a file, start an HTML proxy server.
216+
if (uriScheme === 'http' || uriScheme === 'https') {
217+
// If the path is for a server, start a generic proxy server.
218218
url = await this._commandService.executeCommand<string>(
219-
'positronProxy.startHtmlProxyServer',
219+
'positronProxy.startHttpProxyServer',
220220
targetPath
221221
);
222-
} else if (uriScheme === 'http' || uriScheme === 'https') {
223-
// If the path is for a server, start a generic proxy server.
222+
} else {
223+
// Assume the path is for a file and start an HTML proxy server.
224+
// The uriScheme could be 'file' in this case, or even 'C' if the path is for an HTML
225+
// file on a Windows machine.
224226
url = await this._commandService.executeCommand<string>(
225-
'positronProxy.startHttpProxyServer',
227+
'positronProxy.startHtmlProxyServer',
226228
targetPath
227229
);
228230
}

0 commit comments

Comments
 (0)