提交 06f85af5 编写于 作者: M Matt Bierner

Fix webview csp for web

Fixes #101540

CSP such as https://*.example.com/bla/ don't seem valind. Instead use one that looks like `https://*.example.com`
上级 3a54cd7c
......@@ -208,10 +208,14 @@ export class BrowserWorkbenchEnvironmentService implements IWorkbenchEnvironment
get disableExtensions() { return this.payload?.get('disableExtensions') === 'true'; }
private get webviewEndpoint(): string {
// TODO@matt: get fallback from product.json
return this.options.webviewEndpoint || 'https://{{uuid}}.vscode-webview-test.com/{{commit}}';
}
@memoize
get webviewExternalEndpoint(): string {
// TODO@matt: get fallback from product.json
return (this.options.webviewEndpoint || 'https://{{uuid}}.vscode-webview-test.com/{{commit}}').replace('{{commit}}', product.commit || '0d728c31ebdf03869d2687d9be0b017667c9ff37');
return (this.webviewEndpoint).replace('{{commit}}', product.commit || '0d728c31ebdf03869d2687d9be0b017667c9ff37');
}
@memoize
......@@ -221,7 +225,8 @@ export class BrowserWorkbenchEnvironmentService implements IWorkbenchEnvironment
@memoize
get webviewCspSource(): string {
return this.webviewExternalEndpoint.replace('{{uuid}}', '*');
const uri = URI.parse(this.webviewEndpoint.replace('{{uuid}}', '*'));
return `${uri.scheme}://${uri.authority}`;
}
get disableTelemetry(): boolean { return false; }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册