Make sure we use the webviewResourceRoot on for computing cspSource

Fixes #120879
This commit is contained in:
Matt Bierner 2021-04-08 16:59:59 -07:00
parent 84391165c3
commit 044a99585c
No known key found for this signature in database
GPG key ID: 099C331567E11888

View file

@ -73,7 +73,7 @@ export class NativeWorkbenchEnvironmentService extends AbstractNativeEnvironment
@memoize
get webviewResourceRoot(): string {
// On desktop, this endpoint is only used for the service worker to identify resouce loads and
// On desktop, this endpoint is only used for the service worker to identify resource loads and
// should never actually be requested.
//
// Required due to https://github.com/electron/electron/issues/28528
@ -81,7 +81,10 @@ export class NativeWorkbenchEnvironmentService extends AbstractNativeEnvironment
}
@memoize
get webviewCspSource(): string { return `${Schemas.vscodeWebviewResource}:`; }
get webviewCspSource(): string {
const uri = URI.parse(this.webviewResourceRoot.replace('{{uuid}}', '*'));
return `${uri.scheme}://${uri.authority}`;
}
@memoize
get skipReleaseNotes(): boolean { return !!this.args['skip-release-notes']; }