Repository navigation
Description
Does this issue occur when all extensions are disabled?: Not tested. Reproducing it needs the WSL extension plus an extension that opens a webview from the remote.
- VS Code Version: 1.141.1 (stable, commit 7baac39), Windows desktop
- OS Version: Windows 10.0.26300.9550
- WSL: 3.0.3.0 (kernel 6.18.54.1-1), distro
FedoraLinux-44(Fedora Linux 44) - WSL extension: ms-vscode-remote.remote-wsl 0.104.3
- Extension where it showed up: mhutchie.git-graph 1.30.0
Summary
When a window's remote authority contains uppercase letters, webviews from remote extensions can't load their local resources. Every resource request returns 401 and the webview stays blank.
With WSL, this happens when a folder is opened with code . from a distro whose name has capitals, which gives the remote authority wsl+FedoraLinux-44. The same folder opened with the lowercase authority wsl+fedoralinux-44 works.
Steps to reproduce
- Use a WSL distro with uppercase letters in its name, here
FedoraLinux-44. - In that distro,
cdinto a git repository and runcode .. The window log recordsremoteAuthority=wsl+FedoraLinux-44. - Open a webview from a remote extension that loads its scripts and styles through
asWebviewUriandlocalResourceRoots, for example Git Graph: View Git Graph. - The webview stays blank. The main window's DevTools console shows:
The extension host never receives a message from the webview, because its script never loads.
out.min.css:1 Failed to load resource: the server responded with a status of 401 () out.min.js:1 Failed to load resource: the server responded with a status of 401 () - Close the window and reopen the same folder with a lowercase authority:
The webview now loads normally.
code --folder-uri "vscode-remote://wsl+fedoralinux-44/home/<user>/<repo>"
Expected: webview resources load whatever the case of the remote authority.
Cause
This comes from reading the shipped 1.141.1 bundle. Names below are de-minified approximations; the source files are src/vs/workbench/contrib/webview/browser/webviewElement.ts and resourceLoading.ts.
- The authority gets lowercased. Webview resource URIs carry the authority in a hostname:
https://<scheme>+<encoded authority>.vscode-resource.vscode-cdn.net/.... The webview service worker rebuilds the authority fromURL.hostname, which the browser always lowercases. Sowsl+FedoraLinux-44comes back aswsl+fedoralinux-44. WebviewElement.loadResourcecompares it case-sensitively. It only looks up the remote OS when the request's authority exactly equals the connection's:const remoteOS = uri.scheme === Schemas.vscodeRemote && this._remoteAgentService.getConnection()?.remoteAuthority === uri.authority ? (await this._remoteAgentService.getEnvironment())?.os : undefined;
- The mismatch becomes a 401. With
remoteOSundefined,getResourceToLoadreturns nothing for avscode-remoteURI (if (remoteOS === undefined) return;).loadLocalResourcethen logsWebview.loadLocalResource - access deniedat trace level and returnsAccessDenied.WebviewElementanswers the service worker withstatus: 401.
The root check that follows (extUri.isEqualOrParent → isEqualAuthority) already ignores case. That makes the strict === in loadResource the one case-sensitive step.
Suggested fix: compare the authorities in loadResource with isEqualAuthority, or otherwise ignore case.
Workaround: open WSL folders with a lowercase authority, either with code --folder-uri "vscode-remote://wsl+<distro-lowercase>/<path>" or from File → Open Recent.
Activity
alexr00 commentedon Oct 14, 2026
duplicate of #341396
webview: fix mixed-case remote resource authorities (#341486)
webview: fix mixed-case remote resource authorities (#341488)
webview: fix mixed-case remote resource authorities (#341508)