File tree 2 files changed +26
-0
lines changed
2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change
1
+ Remove parentOriginHash checko
2
+
3
+ This fixes webviews from not working properly due to a change upstream.
4
+ Upstream added a check to ensure parent authority is encoded into the webview
5
+ origin. Since our webview origin is the parent authority, we can bypass this
6
+ check.
7
+
8
+ Index: code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/main.js
9
+ ===================================================================
10
+ --- code-server.orig/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/main.js
11
+ +++ code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/main.js
12
+ @@ -339,12 +339,7 @@ const hostMessaging = new class HostMess
13
+ throw err instanceof Error ? err : new Error(String(err));
14
+ }
15
+
16
+ - if (hostname === parentOriginHash || hostname.startsWith(parentOriginHash + '.')) {
17
+ - // validation succeeded!
18
+ - return start(parentOrigin);
19
+ - }
20
+ -
21
+ - throw new Error(`Expected '${parentOriginHash}' as hostname or subdomain!`);
22
+ + return start(parentOrigin);
23
+ }
24
+ }();
25
+
Original file line number Diff line number Diff line change @@ -18,3 +18,4 @@ service-worker.diff
18
18
connection-type.diff
19
19
sourcemaps.diff
20
20
disable-downloads.diff
21
+ parent-origin.diff
You can’t perform that action at this time.
0 commit comments