Skip to content

Commit

Permalink
Correct identification of uri scheme according to rfc3986
Browse files Browse the repository at this point in the history
Signed-off-by: Vladyslav Zhukovskyi <vzhukovs@redhat.com>
  • Loading branch information
vzhukovs committed Dec 15, 2020
1 parent ae35f9c commit 742c0da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/plugin-ext/src/main/browser/webview/webview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ export class WebviewWidget extends BaseWidget implements StatefulWidget {

protected normalizeRequestUri(requestPath: string): URI {
const normalizedPath = decodeURIComponent(requestPath);
const requestUri = new URI(normalizedPath.replace(/^\/(\w+)\/(.+)$/, (_, scheme, path) => scheme + ':/' + path));
const requestUri = new URI(normalizedPath.replace(/^\/([a-zA-Z0-9.\-+]+)\/(.+)$/, (_, scheme, path) => scheme + ':/' + path));
if (requestUri.scheme !== 'theia-resource' && requestUri.scheme !== 'vscode-resource') {
return requestUri;
}
Expand Down

0 comments on commit 742c0da

Please sign in to comment.