feat(patches): add parent-origin bypass
This commit is contained in:
parent
202630dc19
commit
5e98158c8b
25
patches/parent-origin.diff
Normal file
25
patches/parent-origin.diff
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
Remove parentOriginHash checko
|
||||||
|
|
||||||
|
This fixes webviews from not working properly due to a change upstream.
|
||||||
|
Upstream added a check to ensure parent authority is encoded into the webview
|
||||||
|
origin. Since our webview origin is the parent authority, we can bypass this
|
||||||
|
check.
|
||||||
|
|
||||||
|
Index: code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/main.js
|
||||||
|
===================================================================
|
||||||
|
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/main.js
|
||||||
|
+++ code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/main.js
|
||||||
|
@@ -339,12 +339,7 @@ const hostMessaging = new class HostMess
|
||||||
|
throw err instanceof Error ? err : new Error(String(err));
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (hostname === parentOriginHash || hostname.startsWith(parentOriginHash + '.')) {
|
||||||
|
- // validation succeeded!
|
||||||
|
- return start(parentOrigin);
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- throw new Error(`Expected '${parentOriginHash}' as hostname or subdomain!`);
|
||||||
|
+ return start(parentOrigin);
|
||||||
|
}
|
||||||
|
}();
|
||||||
|
|
@ -18,3 +18,4 @@ service-worker.diff
|
|||||||
connection-type.diff
|
connection-type.diff
|
||||||
sourcemaps.diff
|
sourcemaps.diff
|
||||||
disable-downloads.diff
|
disable-downloads.diff
|
||||||
|
parent-origin.diff
|
||||||
|
Reference in New Issue
Block a user