diff --git a/src/vs/code/browser/workbench/workbench.ts b/src/vs/code/browser/workbench/workbench.ts index 35a23054900bf..289a100e3d492 100644 --- a/src/vs/code/browser/workbench/workbench.ts +++ b/src/vs/code/browser/workbench/workbench.ts @@ -440,12 +440,17 @@ class WindowIndicator implements IWindowIndicator { /** * If the value begins with a slash assume it is a file path and convert it to * use the vscode-remote scheme. + * + * We also add the remote authority in toRemote. It needs to be accurate + * otherwise other URIs won't match it, leading to issues such as this one: + * https://github.com/coder/code-server/issues/4630 * * @author coder */ + const remoteAuthority = location.host const toRemote = (value: string): string => { if (value.startsWith('/')) { - return 'vscode-remote://' + value; + return 'vscode-remote://' + remoteAuthority + value; } return value; }; @@ -564,7 +569,7 @@ class WindowIndicator implements IWindowIndicator { * determine this reliably on the backend. * @author coder */ - remoteAuthority: location.host, + remoteAuthority, /** * Override relative URLs in the product configuration against the window * location as necessary. Only paths that must be absolute need to be