Fix worker require paths when behind proxy

This commit is contained in:
Asher 2020-03-02 17:44:16 -06:00
parent ecac0dd751
commit 77af2a5b0e
No known key found for this signature in database
GPG Key ID: D63C1EF81242354A
3 changed files with 5 additions and 6 deletions

View File

@ -3030,7 +3030,7 @@ index bbb72e9511..0785d3391d 100644
-registerSingleton(IExtensionStoragePaths, class extends NotImplementedProxy(IExtensionStoragePaths) { whenReady = Promise.resolve(); });
+registerSingleton(IExtensionStoragePaths, ExtensionStoragePaths);
diff --git a/src/vs/workbench/services/extensions/worker/extensionHostWorkerMain.ts b/src/vs/workbench/services/extensions/worker/extensionHostWorkerMain.ts
index 79455414c0..8931c1355a 100644
index 79455414c0..a407593b4d 100644
--- a/src/vs/workbench/services/extensions/worker/extensionHostWorkerMain.ts
+++ b/src/vs/workbench/services/extensions/worker/extensionHostWorkerMain.ts
@@ -14,7 +14,11 @@
@ -3040,8 +3040,8 @@ index 79455414c0..8931c1355a 100644
- catchError: true
+ catchError: true,
+ paths: {
+ '@coder/node-browser': `{{BASE}}/static/{{COMMIT}}/lib/vscode/node_modules/@coder/node-browser/out/client/client.js`,
+ '@coder/requirefs': `{{BASE}}/static/{{COMMIT}}/lib/vscode/node_modules/@coder/requirefs/out/requirefs.js`,
+ '@coder/node-browser': `../node_modules/@coder/node-browser/out/client/client.js`,
+ '@coder/requirefs': `../node_modules/@coder/requirefs/out/requirefs.js`,
+ }
});

View File

@ -54,7 +54,7 @@
const url = new URL(window.location.origin + "/" + parts.join("/"))
const el = document.getElementById("vscode-remote-commit")
const commit = el ? el.getAttribute("data-settings") : ""
const staticBase = url.href + "/static/" + commit + "/lib/vscode"
const staticBase = url.href.replace(/\/+$/, "") + "/static/" + commit + "/lib/vscode"
let nlsConfig
try {
nlsConfig = JSON.parse(document.getElementById("vscode-remote-nls-configuration").getAttribute("data-settings"))

View File

@ -23,8 +23,7 @@ export class StaticHttpProvider extends HttpProvider {
const split = route.requestPath.split("/").slice(1)
switch (split[split.length - 1]) {
case "manifest.json":
case "extensionHostWorkerMain.js": {
case "manifest.json": {
const response = await this.getUtf8Resource(this.rootPath, ...split)
return this.replaceTemplates(route, response)
}