From 77af2a5b0e606bec43edf153c1179525237e9bff Mon Sep 17 00:00:00 2001 From: Asher Date: Mon, 2 Mar 2020 17:44:16 -0600 Subject: [PATCH] Fix worker require paths when behind proxy --- ci/vscode.patch | 6 +++--- src/browser/pages/vscode.html | 2 +- src/node/app/static.ts | 3 +-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/ci/vscode.patch b/ci/vscode.patch index ea2fdc3f..ec2b780c 100644 --- a/ci/vscode.patch +++ b/ci/vscode.patch @@ -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`, + } }); diff --git a/src/browser/pages/vscode.html b/src/browser/pages/vscode.html index fa2b82af..acead2e4 100644 --- a/src/browser/pages/vscode.html +++ b/src/browser/pages/vscode.html @@ -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")) diff --git a/src/node/app/static.ts b/src/node/app/static.ts index 57e1ece3..93be8f40 100644 --- a/src/node/app/static.ts +++ b/src/node/app/static.ts @@ -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) }