Skip to content

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

Merged
Matt Bierner (mjbvz) merged 3 commits into
microsoft: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
Matt Bierner (mjbvz) merged 3 commits into
microsoft:masterfrom
hadzhiyski:vh/open-md-from-shared-folder

Conversation

@hadzhiyski

Copy link
Copy Markdown
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 Vladislav 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 Matt Bierner (mjbvz) self-assigned this Nov 13, 2019
@hadzhiyski

Copy link
Copy Markdown
Contributor Author

Hello, Matt Bierner (@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
Copy Markdown
Contributor

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
Copy Markdown
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

@hadzhiyski Vladislav Hadzhiyski (hadzhiyski) Nov 15, 2019

Copy link
Copy Markdown
Contributor Author

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.

@mjbvz

Copy link
Copy Markdown
Contributor

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

@mjbvz Matt Bierner (mjbvz) added this to the November 2019 milestone Nov 16, 2019
@hadzhiyski

Copy link
Copy Markdown
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