提交 de010f53 编写于 作者: M Matt Bierner

Only use endpoint origin when rewriting csp in webviews

上级 5a261cd8
......@@ -308,7 +308,12 @@
} else {
// Rewrite vscode-resource in csp
if (data.endpoint) {
csp.setAttribute('content', csp.getAttribute('content').replace(/vscode-resource:/g, data.endpoint));
try {
const endpointUrl = new URL(data.endpoint);
csp.setAttribute('content', csp.getAttribute('content').replace(/vscode-resource:(?=(\s|;|$))/g, endpointUrl.origin));
} catch (e) {
console.error('Could not rewrite csp');
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册