Repository navigation
webview: fix mixed-case remote resource authorities - #341508
Merged
Merged
Conversation
Compare remote authorities case-insensitively when resolving the target OS, matching browser hostname normalization without weakening resource-root containment. Add resource-message regression tests for mixed-case WSL and SSH authorities and access-denied controls. Fixes #341396\nFixes #341398\nFixes #341431\nFixes #341423\nFixes #341451\nFixes #341458\nFixes #341473\nFixes #341474 Co-authored-by: Copilot <[email protected]>
Giuseppe Cianci (Giuspepe)
approved these changes
Oct 14, 2026
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused fix addresses the regression while preserving authority, OS, and resource-root security checks.
0 open findings
What changed in this PR
Fixes remote webview resource loading when browsers lowercase mixed-case remote authorities.
Changes:
- Uses case-insensitive authority comparison for remote OS lookup.
- Adds regression and access-control tests across remote platforms.
| File | Description |
|---|---|
webviewElement.ts |
Compares remote authorities case-insensitively. |
webviewElement.test.ts |
Tests normalized authorities and denial cases. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
Nick Trogh (ntrogh)
self-requested a review
October 14, 2026 10:52
Ulugbek Abdullaev (ulugbekna)
approved these changes
Oct 14, 2026
Nick Trogh (ntrogh)
approved these changes
Oct 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix blank webviews in remote windows whose authority contains uppercase letters, such as
wsl+Ubuntuandwsl+FedoraLinux-44.Webview resource URLs carry the remote authority in an HTTPS hostname, which the browser lowercases. The remote-OS lookup compared this normalized authority with the connection authority using strict equality, so it skipped the environment lookup and rejected otherwise valid resources with 401.
Use the existing case-insensitive authority comparison for that lookup. Target-OS-specific path normalization, resource-root containment, and rejection of different authorities or unknown remote operating systems remain unchanged.
Regression cause
Introduced by b0240f4c8e — Fix remote webview resource path containment, included in 1.141.1 and subsequently adopted on main in #341342. The introducing commit is absent from 1.141.0, and the known-good 1.140.0 loader has no remote-OS gate.
Fixed issues
Fixes #341396
Fixes #341398
Fixes #341431
Fixes #341423
Fixes #341451
Fixes #341458
Fixes #341473
Fixes #341474
Fixes #341421
Fixes #341440
Fixes #341444
Fixes #341461
Fixes #341469
Fixes #341475
Fixes #341482