Skip to content

#83646 Webview: Cannot load resource outside of protocol root", if .md source is an network share#84702

Merged
mjbvz merged 3 commits intomicrosoft:masterfrom
hadzhiyski:vh/open-md-from-shared-folder
Nov 16, 2019
Merged

#83646 Webview: Cannot load resource outside of protocol root", if .md source is an network share#84702
mjbvz merged 3 commits intomicrosoft:masterfrom
hadzhiyski:vh/open-md-from-shared-folder

Conversation

@hadzhiyski
Copy link
Contributor

ElectronWebviewBasedWebview local resource roots are with uppercase authority (host name)

This PR fixes #83646

ElectronWebviewBasedWebview local resource roots are with uppercase authority (host name)
@hadzhiyski hadzhiyski changed the title #83646 Check resource lower case URIs strings when running on Windows #83646 Webview: Cannot load resource outside of protocol root", if .md source is an network share Nov 13, 2019
@mjbvz mjbvz self-assigned this Nov 13, 2019
@hadzhiyski
Copy link
Contributor Author

Hello, @mjbvz ,

I am quite new to the vscode repository. Could you give me any guidelines if I am missing something? In my opinion the issue is fixed with latest changes.


// windows paths are case insensitive
// when checking remote host, the host name is uppercase
if (extensionLocation && (
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure this is the correct fix? This code only applies if the extension is running remotely (which seems unrelated to #83646)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah... I was mistaken. I think I fixed it with the latest changes. The issue comes from the following - Electron is providing the UNC root authority in uppercase and the resource is requested with lowercase authority.
image

Copy link
Contributor Author

@hadzhiyski hadzhiyski Nov 15, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isUNC(root.fsPath) && isUNC(resource.fsPath) this should do. It's tested on a Windows 10 desktop.

@hadzhiyski hadzhiyski requested a review from mjbvz November 15, 2019 09:04
@mjbvz mjbvz merged commit 154f2dd into microsoft:master Nov 16, 2019
@mjbvz
Copy link
Collaborator

mjbvz commented Nov 16, 2019

Thanks! This fix will be in the next insiders build and is scheduled to ship with VS Code 1.41 early next month

@mjbvz mjbvz added this to the November 2019 milestone Nov 16, 2019
@hadzhiyski
Copy link
Contributor Author

Thank you for the support!

@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Webview: Cannot load resource outside of protocol root", if .md source is an network share

2 participants