Skip to content

fix: use remoteAuthority with URIs for accuracy #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/vs/code/browser/workbench/workbench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down Expand Up @@ -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
Expand Down