Skip to content

Commit

Permalink
default to HTML file proxy unless uri is http or https (#4939) (#4945)
Browse files Browse the repository at this point in the history
Backports the fix for #4930
to the `2024.10` release by cherry-picking the commit from
#4939.

Co-authored-by: sharon wang <[email protected]>
  • Loading branch information
sharon-wang and sharon-wang authored Oct 8, 2024
1 parent 34b5c57 commit 901ab5d
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>(
'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<string>(
'positronProxy.startHttpProxyServer',
'positronProxy.startHtmlProxyServer',
targetPath
);
}
Expand Down

0 comments on commit 901ab5d

Please sign in to comment.