Skip to content

Commit 4b68911

Browse files
committed
Update server hash
1 parent ee77b86 commit 4b68911

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

‎ci/build/update-vscode.sh‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,14 @@ function update_csp() {
101101
echo "Calculated hash as $hash"
102102
# Use octothorpe as a delimiter since the hash may contain a slash.
103103
sed -i.bak "s#'sha256-[^']\+'#'sha256-$hash'#" "$file"
104+
# For the web worker extension host iframe, there is a matching sha in the
105+
# web server.
106+
if [[ $file == */webWorkerExtensionHostIframe.html ]] ; then
107+
quilt add ./lib/vscode/src/vs/server/node/webClientServer.ts
108+
sed -i.bak \
109+
"s#webWorkerExtensionHostIframeScriptSHA = 'sha256-[^']\+'#webWorkerExtensionHostIframeScriptSHA = 'sha256-$hash'#" \
110+
./lib/vscode/src/vs/server/node/webClientServer.ts
111+
fi
104112
done
105113

106114
quilt refresh

‎patches/csp-hashes.diff‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,16 @@ Index: code-server/lib/vscode/src/vs/workbench/services/extensions/worker/webWor
2424
connect-src 'self' https: wss: http://localhost:* http://127.0.0.1:* ws://localhost:* ws://127.0.0.1:*;"/>
2525
</head>
2626
<body>
27+
Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
28+
===================================================================
29+
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
30+
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
31+
@@ -114,7 +114,7 @@ const APP_ROOT = dirname(FileAccess.asFi
32+
const STATIC_PATH = `/static`;
33+
const CALLBACK_PATH = `/callback`;
34+
const WEB_EXTENSION_PATH = `/web-extension-resource`;
35+
-const webWorkerExtensionHostIframeScriptSHA = 'sha256-daEgfo2VIXpx2Np71KqCCbkeQwv+68vPrx54XRcbdcs=';
36+
+const webWorkerExtensionHostIframeScriptSHA = 'sha256-gfjiOVjAlxqrivZAfTq2d83mOaz0fnAxbGaFpj5IjD8=';
37+
38+
/**
39+
* Substitutes the `{{...}}` placeholders of a workbench template. Placeholders must only ever

0 commit comments

Comments
 (0)