@@ -3,6 +3,11 @@ Add Open VSX default and an env var for marketplace, fix old marketplace
33Our old marketplace only supports `serviceUrl` but this causes the marketplace
44to be disabled entirely so this moves the template var check to fix that.
55
6+ This also removes serverRootPath from the web extension route because that will
7+ include the commit. When you update code-server the web extension will continue
8+ using this path since it is stored in the browser but the path will 404 because
9+ the commit no longer matches.
10+
611This can be tested by setting EXTENSIONS_GALLERY set to:
712
813 '{"serviceUrl": "https://extensions.coder.com/api"}'
@@ -32,22 +37,19 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
3237===================================================================
3338--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
3439+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
35- @@ -308,14 +308,14 @@ export class WebClientServer {
40+ @@ -308,14 +308,7 @@ export class WebClientServer {
3641 codeServerVersion: this._productService.codeServerVersion,
3742 rootEndpoint: base,
3843 embedderIdentifier: 'server-distro',
3944- extensionsGallery: this._webExtensionResourceUrlTemplate ? {
40- + extensionsGallery: {
41- ...this._productService.extensionsGallery,
45+ - ...this._productService.extensionsGallery,
4246- 'resourceUrlTemplate': this._webExtensionResourceUrlTemplate.with({
43- + 'resourceUrlTemplate': this._webExtensionResourceUrlTemplate ? this._webExtensionResourceUrlTemplate.with({
44- scheme: 'http',
45- authority: remoteAuthority,
46- path: `${this._webExtensionRoute}/${this._webExtensionResourceUrlTemplate.authority}${this._webExtensionResourceUrlTemplate.path}`
47+ - scheme: 'http',
48+ - authority: remoteAuthority,
49+ - path: `${this._webExtensionRoute}/${this._webExtensionResourceUrlTemplate.authority}${this._webExtensionResourceUrlTemplate.path}`
4750- }).toString(true)
4851- } : undefined
49- + }).toString(true) : undefined
50- + }
52+ + extensionsGallery: this._productService.extensionsGallery,
5153 },
5254 callbackRoute: this._callbackRoute
5355 };
0 commit comments