Support schemes with - in the name, such as vscode-remote

This commit is contained in:
Matt Bierner
2020-08-25 12:17:21 -07:00
parent 4b222a704f
commit 02bafd47bb
@@ -54,7 +54,7 @@ export class IFrameWebview extends BaseWebview<HTMLIFrameElement> implements Web
this._register(this.on(WebviewMessageChannels.loadResource, (entry: any) => {
const rawPath = entry.path;
const normalizedPath = decodeURIComponent(rawPath);
const uri = URI.parse(normalizedPath.replace(/^\/(\w+)\/(.+)$/, (_, scheme, path) => scheme + ':/' + path));
const uri = URI.parse(normalizedPath.replace(/^\/([\w\-]+)\/(.+)$/, (_, scheme, path) => scheme + ':/' + path));
this.loadResource(rawPath, uri);
}));