@@ -10,7 +10,7 @@ Index: code-server/lib/vscode/src/vs/base/common/network.ts
1010===================================================================
1111--- code-server.orig/lib/vscode/src/vs/base/common/network.ts
1212+++ code-server/lib/vscode/src/vs/base/common/network.ts
13- @@ -245 ,7 +245 ,9 @@ class RemoteAuthoritiesImpl {
13+ @@ -251 ,7 +251 ,9 @@ class RemoteAuthoritiesImpl {
1414 return URI.from({
1515 scheme: platform.isWeb ? this._preferredWebSchema : Schemas.vscodeRemoteResource,
1616 authority: `${host}:${port}`,
@@ -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- @@ -265 ,7 +265 ,9 @@ export class WebClientServer {
114+ @@ -264 ,7 +264 ,9 @@ export class WebClientServer {
115115 };
116116
117117 // Prefix routes with basePath for clients
@@ -120,9 +120,9 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
120120+ const vscodeBase = relativePath(getOriginalUrl(req))
121121+ const basePath = vscodeBase || getFirstHeader('x-forwarded-prefix') || this._basePath;
122122
123- const queryConnectionToken = parsedUrl.query[ connectionTokenQueryName] ;
124- if (typeof queryConnectionToken === 'string' ) {
125- @@ -304 ,10 +306 ,14 @@ export class WebClientServer {
123+ const queryConnectionTokens = parsedUrl.searchParams.getAll( connectionTokenQueryName) ;
124+ if (queryConnectionTokens.length === 1 ) {
125+ @@ -301 ,10 +303 ,14 @@ export class WebClientServer {
126126 };
127127
128128 const useTestResolver = (!this._environmentService.isBuilt && this._environmentService.args['use-test-resolver']);
@@ -138,15 +138,15 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
138138 );
139139 if (!remoteAuthority) {
140140 return serveError(req, res, 400, `Bad request.`);
141- @@ -354 ,6 +360 ,7 @@ export class WebClientServer {
141+ @@ -351 ,6 +357 ,7 @@ export class WebClientServer {
142142
143143 const productConfiguration: Partial<Mutable<IProductConfiguration>> = {
144144 codeServerVersion: this._productService.codeServerVersion,
145145+ rootEndpoint: rootBase,
146146 embedderIdentifier: 'server-distro',
147147 voiceWsUrl: this._productService.voiceWsUrl,
148148 extensionsGallery: this._webExtensionResourceUrlTemplate && this._productService.extensionsGallery ? {
149- @@ -403 ,7 +410 ,9 @@ export class WebClientServer {
149+ @@ -400 ,7 +407 ,9 @@ export class WebClientServer {
150150 WORKBENCH_AUTH_SESSION: authSessionInfo ? asJSON(authSessionInfo) : '',
151151 WORKBENCH_WEB_BASE_URL: staticRoute,
152152 WORKBENCH_NLS_URL,
@@ -157,7 +157,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
157157 };
158158
159159 // DEV ---------------------------------------------------------------------------------------
160- @@ -440 ,7 +449 ,7 @@ export class WebClientServer {
160+ @@ -437 ,7 +446 ,7 @@ export class WebClientServer {
161161 'default-src \'self\';',
162162 'img-src \'self\' https: data: blob:;',
163163 'media-src \'self\';',
@@ -166,7 +166,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
166166 'child-src \'self\';',
167167 `frame-src 'self' https://*.vscode-cdn.net data:;`,
168168 'worker-src \'self\' data: blob:;',
169- @@ -513 ,3 +522 ,70 @@ export class WebClientServer {
169+ @@ -510 ,3 +519 ,70 @@ export class WebClientServer {
170170 return void res.end(data);
171171 }
172172 }
0 commit comments