@@ -86,10 +86,10 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.html
8686 <link data-name="vs/workbench/workbench.web.main" rel="stylesheet" href="{{WORKBENCH_WEB_BASE_URL}}/out/vs/workbench/workbench.web.main.css">
8787
8888 </head>
89- @@ -38,7 +38,7 @@
90- <script src="{{WORKBENCH_WEB_BASE_URL}}/out/vs/loader.js"></script>
91- <script src="{{WORKBENCH_WEB_BASE_URL}}/out/vs/webPackagePaths.js"></script>
89+ @@ -40,7 +40,7 @@
9290 <script>
91+
92+ // Packages
9393- const baseUrl = new URL('{{WORKBENCH_WEB_BASE_URL}}', window.location.origin).toString();
9494+ const baseUrl = new URL('{{WORKBENCH_WEB_BASE_URL}}', window.location).toString();
9595 Object.keys(self.webPackagePaths).map(function (key, index) {
@@ -111,7 +111,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
111111===================================================================
112112--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
113113+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
114- @@ -270 ,16 +270 ,15 @@ export class WebClientServer {
114+ @@ -269 ,16 +269 ,15 @@ export class WebClientServer {
115115 return void res.end();
116116 }
117117
@@ -133,7 +133,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
133133 );
134134 if (!remoteAuthority) {
135135 return serveError(req, res, 400, `Bad request.`);
136- @@ -306 ,8 +305 ,12 @@ export class WebClientServer {
136+ @@ -305 ,8 +304 ,12 @@ export class WebClientServer {
137137 scopes: [['user:email'], ['repo']]
138138 } : undefined;
139139
@@ -146,29 +146,48 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
146146 embedderIdentifier: 'server-distro',
147147 extensionsGallery: this._webExtensionResourceUrlTemplate && this._productService.extensionsGallery ? {
148148 ...this._productService.extensionsGallery,
149- @@ -343,8 +346,10 @@ export class WebClientServer {
149+ @@ -335,7 +338,7 @@ export class WebClientServer {
150+ folderUri: resolveWorkspaceURI(this._environmentService.args['default-folder']),
151+ workspaceUri: resolveWorkspaceURI(this._environmentService.args['default-workspace']),
152+ productConfiguration,
153+ - callbackRoute: this._callbackRoute
154+ + callbackRoute: vscodeBase + this._callbackRoute
155+ };
156+
157+ const cookies = cookie.parse(req.headers.cookie || '');
158+ @@ -343,7 +346,7 @@ export class WebClientServer {
159+ let WORKBENCH_NLS_BASE_URL: string | undefined;
160+ let WORKBENCH_NLS_URL: string;
161+ if (!locale.startsWith('en') && this._productService.nlsCoreBaseUrl) {
162+ - WORKBENCH_NLS_BASE_URL = this._productService.nlsCoreBaseUrl;
163+ + WORKBENCH_NLS_BASE_URL = vscodeBase + this._productService.nlsCoreBaseUrl;
164+ WORKBENCH_NLS_URL = `${WORKBENCH_NLS_BASE_URL}${this._productService.commit}/${this._productService.version}/${locale}/nls.messages.js`;
165+ } else {
166+ WORKBENCH_NLS_URL = ''; // fallback will apply
167+ @@ -352,9 +355,11 @@ export class WebClientServer {
150168 const values: { [key: string]: string } = {
151169 WORKBENCH_WEB_CONFIGURATION: asJSON(workbenchWebConfiguration),
152170 WORKBENCH_AUTH_SESSION: authSessionInfo ? asJSON(authSessionInfo) : '',
153171- WORKBENCH_WEB_BASE_URL: this._staticRoute,
154- - WORKBENCH_NLS_BASE_URL: nlsBaseUrl ? `${nlsBaseUrl}${!nlsBaseUrl.endsWith('/') ? '/' : ''}${this._productService.commit}/${this._productService.version}/` : '',
155172+ WORKBENCH_WEB_BASE_URL: vscodeBase + this._staticRoute,
156- + WORKBENCH_NLS_BASE_URL: vscodeBase + (nlsBaseUrl ? `${nlsBaseUrl}${!nlsBaseUrl.endsWith('/') ? '/' : ''}${this._productService.commit}/${this._productService.version}/` : ''),
173+ WORKBENCH_NLS_URL,
174+ - WORKBENCH_NLS_FALLBACK_URL: `${this._staticRoute}/out/nls.messages.js`
175+ + WORKBENCH_NLS_FALLBACK_URL: `${vscodeBase}${this._staticRoute}/out/nls.messages.js`,
157176+ BASE: base,
158177+ VS_BASE: vscodeBase,
159178 };
160179
161180 if (useTestResolver) {
162- @@ -371 ,7 +376 ,7 @@ export class WebClientServer {
181+ @@ -381 ,7 +386 ,7 @@ export class WebClientServer {
163182 'default-src \'self\';',
164183 'img-src \'self\' https: data: blob:;',
165184 'media-src \'self\';',
166- - `script-src 'self' 'unsafe-eval' ${this._getScriptCspHashes(data).join(' ')} '${webWorkerExtensionHostIframeScriptSHA}' ${useTestResolver ? '' : `http://${remoteAuthority}`};`, // the sha is the same as in src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html
167- + `script-src 'self' 'unsafe-eval' ${this._getScriptCspHashes(data).join(' ')} '${webWorkerExtensionHostIframeScriptSHA}' ${useTestResolver ? '' : '' };`, // the sha is the same as in src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html
185+ - `script-src 'self' 'unsafe-eval' ${WORKBENCH_NLS_BASE_URL ?? ''} ${ this._getScriptCspHashes(data).join(' ')} '${webWorkerExtensionHostIframeScriptSHA}' ${useTestResolver ? '' : `http://${remoteAuthority}`};`, // the sha is the same as in src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html
186+ + `script-src 'self' 'unsafe-eval' ${WORKBENCH_NLS_BASE_URL ?? ''} ${ this._getScriptCspHashes(data).join(' ')} '${webWorkerExtensionHostIframeScriptSHA}' ${useTestResolver ? '' : `` };`, // the sha is the same as in src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html
168187 'child-src \'self\';',
169188 `frame-src 'self' https://*.vscode-cdn.net data:;`,
170189 'worker-src \'self\' data: blob:;',
171- @@ -444 ,3 +449 ,70 @@ export class WebClientServer {
190+ @@ -454 ,3 +459 ,70 @@ export class WebClientServer {
172191 return void res.end(data);
173192 }
174193 }
@@ -298,15 +317,7 @@ Index: code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/ext
298317===================================================================
299318--- code-server.orig/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
300319+++ code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
301- @@ -16,7 +16,6 @@ import { getServiceMachineId } from 'vs/
302- import { IStorageService } from 'vs/platform/storage/common/storage';
303- import { TelemetryLevel } from 'vs/platform/telemetry/common/telemetry';
304- import { getTelemetryLevel, supportsTelemetry } from 'vs/platform/telemetry/common/telemetryUtils';
305- - import { RemoteAuthorities } from 'vs/base/common/network';
306- import { TargetPlatform } from 'vs/platform/extensions/common/extensions';
307-
308- const WEB_EXTENSION_RESOURCE_END_POINT_SEGMENT = '/web-extension-resource/';
309- @@ -99,7 +98,7 @@ export abstract class AbstractExtensionR
320+ @@ -98,7 +98,7 @@ export abstract class AbstractExtensionR
310321 : version,
311322 path: 'extension'
312323 }));
0 commit comments