@@ -86,10 +86,10 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.html
86
86
<link data-name="vs/workbench/workbench.web.main" rel="stylesheet" href="{{WORKBENCH_WEB_BASE_URL}}/out/vs/workbench/workbench.web.main.css">
87
87
88
88
</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 @@
92
90
<script>
91
+
92
+ // Packages
93
93
- const baseUrl = new URL('{{WORKBENCH_WEB_BASE_URL}}', window.location.origin).toString();
94
94
+ const baseUrl = new URL('{{WORKBENCH_WEB_BASE_URL}}', window.location).toString();
95
95
Object.keys(self.webPackagePaths).map(function (key, index) {
@@ -111,7 +111,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
111
111
===================================================================
112
112
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
113
113
+++ 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 {
115
115
return void res.end();
116
116
}
117
117
@@ -133,7 +133,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
133
133
);
134
134
if (!remoteAuthority) {
135
135
return serveError(req, res, 400, `Bad request.`);
136
- @@ -306 ,8 +305 ,12 @@ export class WebClientServer {
136
+ @@ -305 ,8 +304 ,12 @@ export class WebClientServer {
137
137
scopes: [['user:email'], ['repo']]
138
138
} : undefined;
139
139
@@ -146,29 +146,48 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
146
146
embedderIdentifier: 'server-distro',
147
147
extensionsGallery: this._webExtensionResourceUrlTemplate && this._productService.extensionsGallery ? {
148
148
...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 {
150
168
const values: { [key: string]: string } = {
151
169
WORKBENCH_WEB_CONFIGURATION: asJSON(workbenchWebConfiguration),
152
170
WORKBENCH_AUTH_SESSION: authSessionInfo ? asJSON(authSessionInfo) : '',
153
171
- WORKBENCH_WEB_BASE_URL: this._staticRoute,
154
- - WORKBENCH_NLS_BASE_URL: nlsBaseUrl ? `${nlsBaseUrl}${!nlsBaseUrl.endsWith('/') ? '/' : ''}${this._productService.commit}/${this._productService.version}/` : '',
155
172
+ 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`,
157
176
+ BASE: base,
158
177
+ VS_BASE: vscodeBase,
159
178
};
160
179
161
180
if (useTestResolver) {
162
- @@ -371 ,7 +376 ,7 @@ export class WebClientServer {
181
+ @@ -381 ,7 +386 ,7 @@ export class WebClientServer {
163
182
'default-src \'self\';',
164
183
'img-src \'self\' https: data: blob:;',
165
184
'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
168
187
'child-src \'self\';',
169
188
`frame-src 'self' https://*.vscode-cdn.net data:;`,
170
189
'worker-src \'self\' data: blob:;',
171
- @@ -444 ,3 +449 ,70 @@ export class WebClientServer {
190
+ @@ -454 ,3 +459 ,70 @@ export class WebClientServer {
172
191
return void res.end(data);
173
192
}
174
193
}
@@ -298,15 +317,7 @@ Index: code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/ext
298
317
===================================================================
299
318
--- code-server.orig/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
300
319
+++ 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
310
321
: version,
311
322
path: 'extension'
312
323
}));
0 commit comments