Skip to content

Commit 592d9bc

Browse files
committed
fix(lib/vscode): update csp in webview to allow ports
With #3895, we caused a regression where the Content-Security-Policy prevented images in the previewer to not work due to the ports in the resource URI. This modifies the CSP in the webview to make sure images are not blocked by CSP. I assume once we upgrade VS Code, we will revert this change.
1 parent 8a1c129 commit 592d9bc

File tree

1 file changed

+4
-1
lines changed
  • lib/vscode/src/vs/workbench/api/common/shared

1 file changed

+4
-1
lines changed

lib/vscode/src/vs/workbench/api/common/shared/webview.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ export const webviewResourceBaseHost = 'vscode-webview.net';
2424

2525
export const webviewRootResourceAuthority = `vscode-resource.${webviewResourceBaseHost}`;
2626

27-
export const webviewGenericCspSource = `https://*.${webviewResourceBaseHost}`;
27+
// NOTE@coder: This is a temporary change to include ":*"
28+
// due to the patch we had to make for webview resources.
29+
// See PR#3895 and https://github.com/cdr/code-server/issues/3936 for more details.
30+
export const webviewGenericCspSource = `https://*.${webviewResourceBaseHost}:*`;
2831

2932
/**
3033
* Construct a uri that can load resources inside a webview

0 commit comments

Comments
 (0)