@@ -10,7 +10,7 @@ Index: code-server/lib/vscode/src/vs/base/common/network.ts
10
10
===================================================================
11
11
--- code-server.orig/lib/vscode/src/vs/base/common/network.ts
12
12
+++ code-server/lib/vscode/src/vs/base/common/network.ts
13
- @@ -166 ,7 +166 ,9 @@ class RemoteAuthoritiesImpl {
13
+ @@ -167 ,7 +167 ,9 @@ class RemoteAuthoritiesImpl {
14
14
return URI.from({
15
15
scheme: platform.isWeb ? this._preferredWebSchema : Schemas.vscodeRemoteResource,
16
16
authority: `${host}:${port}`,
@@ -136,24 +136,20 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
136
136
if (!remoteAuthority) {
137
137
return serveError(req, res, 400, `Bad request.`);
138
138
}
139
- @@ -298,6 +297,8 @@ export class WebClientServer {
139
+ @@ -298,8 +297,12 @@ export class WebClientServer {
140
140
scopes: [['user:email'], ['repo']]
141
141
} : undefined;
142
142
143
143
+ const base = relativeRoot(getOriginalUrl(req))
144
144
+ const vscodeBase = relativePath(getOriginalUrl(req))
145
-
146
- const workbenchWebConfiguration = {
147
- remoteAuthority,
148
- @@ -309,6 +310,7 @@ export class WebClientServer {
149
- workspaceUri: resolveWorkspaceURI(this._environmentService.args['default-workspace']),
150
- productConfiguration: <Partial<IProductConfiguration>>{
151
- codeServerVersion: this._productService.codeServerVersion,
152
- + rootEndpoint: base,
153
- embedderIdentifier: 'server-distro',
154
- extensionsGallery: this._webExtensionResourceUrlTemplate ? {
155
- ...this._productService.extensionsGallery,
156
- @@ -326,8 +328,10 @@ export class WebClientServer {
145
+ +
146
+ const productConfiguration = <Partial<IProductConfiguration>>{
147
+ codeServerVersion: this._productService.codeServerVersion,
148
+ + rootEndpoint: base,
149
+ embedderIdentifier: 'server-distro',
150
+ extensionsGallery: this._webExtensionResourceUrlTemplate ? {
151
+ ...this._productService.extensionsGallery,
152
+ @@ -334,11 +337,12 @@ export class WebClientServer {
157
153
const values: { [key: string]: string } = {
158
154
WORKBENCH_WEB_CONFIGURATION: asJSON(workbenchWebConfiguration),
159
155
WORKBENCH_AUTH_SESSION: authSessionInfo ? asJSON(authSessionInfo) : '',
@@ -165,8 +161,11 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
165
161
+ VS_BASE: vscodeBase,
166
162
};
167
163
168
-
169
- @@ -344,7 +348,7 @@ export class WebClientServer {
164
+ -
165
+ let data;
166
+ try {
167
+ const workbenchTemplate = (await fsp.readFile(filePath)).toString();
168
+ @@ -352,7 +356,7 @@ export class WebClientServer {
170
169
'default-src \'self\';',
171
170
'img-src \'self\' https: data: blob:;',
172
171
'media-src \'self\';',
@@ -175,7 +174,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
175
174
'child-src \'self\';',
176
175
`frame-src 'self' https://*.vscode-cdn.net data:;`,
177
176
'worker-src \'self\' data: blob:;',
178
- @@ -417 ,3 +421 ,70 @@ export class WebClientServer {
177
+ @@ -425 ,3 +429 ,70 @@ export class WebClientServer {
179
178
return void res.end(data);
180
179
}
181
180
}
0 commit comments