@@ -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- @@ -146 ,7 +146 ,7 @@ export function createWorkbenchContentSe
114+ @@ -147 ,7 +147 ,7 @@ export function createWorkbenchContentSe
115115 'default-src \'self\';',
116116 'img-src \'self\' https: data: blob:;',
117117 'media-src \'self\';',
@@ -120,19 +120,18 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
120120 'child-src \'self\';',
121121 `frame-src 'self' https://*.vscode-cdn.net data:;`,
122122 'worker-src \'self\' data: blob:;',
123- @@ -307,8 +307,10 @@ export class WebClientServer {
124- };
125-
123+ @@ -331,7 +331,9 @@ export class WebClientServer {
124+ */
125+ private async _handleRoot(req: http.IncomingMessage, res: http.ServerResponse, parsedUrl: URL): Promise<void> {
126126 // Prefix routes with basePath for clients
127+ - const basePath = this._getEffectiveBasePath(req);
127128+ const rootBase = relativeRoot(getOriginalUrl(req))
128129+ const vscodeBase = relativePath(getOriginalUrl(req))
129- const forwardedPrefix = getFirstHeader('x-forwarded-prefix');
130- - const basePath = forwardedPrefix && isSafeBasePath(forwardedPrefix) ? forwardedPrefix : this._basePath;
131- + const basePath = vscodeBase || (forwardedPrefix && isSafeBasePath(forwardedPrefix) ? forwardedPrefix : this._basePath);
130+ + const basePath = vscodeBase || this._getEffectiveBasePath(req);
132131
133132 const queryConnectionTokens = parsedUrl.searchParams.getAll(connectionTokenQueryName);
134133 if (queryConnectionTokens.length === 1) {
135- @@ -345 ,10 +347 ,14 @@ export class WebClientServer {
134+ @@ -368 ,10 +370 ,14 @@ export class WebClientServer {
136135 };
137136
138137 const useTestResolver = (!this._environmentService.isBuilt && !!this._environmentService.args['use-test-resolver']);
@@ -143,20 +142,20 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
143142 let remoteAuthority = (
144143 useTestResolver
145144 ? 'test+test'
146- - : (getFirstHeader( 'x-original-host') || getFirstHeader( 'x-forwarded-host') || req.headers.host)
145+ - : (this._getFirstHeader(req, 'x-original-host') || this._getFirstHeader(req, 'x-forwarded-host') || req.headers.host)
147146+ : 'remote'
148147 );
149148 if (!remoteAuthority) {
150149 return serveError(req, res, 400, `Bad request.`);
151- @@ -395 ,6 +401 ,7 @@ export class WebClientServer {
150+ @@ -418 ,6 +424 ,7 @@ export class WebClientServer {
152151
153152 const productConfiguration: Partial<Mutable<IProductConfiguration>> = {
154153 codeServerVersion: this._productService.codeServerVersion,
155154+ rootEndpoint: rootBase,
156155 embedderIdentifier: 'server-distro',
157156 voiceWsUrl: this._productService.voiceWsUrl,
158157 extensionsGallery: this._webExtensionResourceUrlTemplate && this._productService.extensionsGallery ? {
159- @@ -446 ,7 +453 ,9 @@ export class WebClientServer {
158+ @@ -469 ,7 +476 ,9 @@ export class WebClientServer {
160159 WORKBENCH_WEB_BASE_URL: staticRoute,
161160 WORKBENCH_NLS_URL,
162161 WORKBENCH_NLS_FALLBACK_URL: `${staticRoute}/out/nls.messages.js`,
@@ -167,7 +166,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
167166 };
168167
169168 // DEV ---------------------------------------------------------------------------------------
170- @@ -542 ,3 +551 ,70 @@ export class WebClientServer {
169+ @@ -578 ,3 +587 ,70 @@ export class WebClientServer {
171170 return void res.end(data);
172171 }
173172 }
@@ -242,7 +241,7 @@ Index: code-server/lib/vscode/src/vs/base/common/product.ts
242241===================================================================
243242--- code-server.orig/lib/vscode/src/vs/base/common/product.ts
244243+++ code-server/lib/vscode/src/vs/base/common/product.ts
245- @@ -98 ,6 +98 ,7 @@ export interface IDictationRuntimeProduc
244+ @@ -118 ,6 +118 ,7 @@ export interface IDictationRuntimeProduc
246245
247246 export interface IProductConfiguration {
248247 readonly codeServerVersion?: string
0 commit comments