Skip to content

Commit 5ce99f8

Browse files
authored
chore: update Code to 1.68 (#5263)
* chore: update Code to 1.67 Was able to remove our changes to common/webview.ts since they are upstream now. Other than that no serious changes, just context diffs. * chore: update Code to 1.68 - Upstream moved the web socket endpoint so change the Express route from / to *. That will let web sockets work at any endpoint. - Everything in the workbench config is basically the same but de-indented (upstream extracted it into a separate object which resulted in a de-indent), the ordering is slightly different, and instead of vscodeBase we now need vscodeBase + this._staticRoute since everything is served from a sub-path now. - Move manifest link back to the root since that is where we host our manifest. - Change RemoteAuthoritiesImpl to use the same path building method as in other places (+ instead of using URI.parse/join). - Use existing host/port in RemoteAuthoritiesImpl and BrowserSocketFactory instead of patching them to use window.location (these are set from window.location to begin with so it should be the same result but with less patching). - Since BrowserSocketFactory includes a sub-path now (endpoints were changed upstream to serve from /quality/commit instead of from the root) the patch there has changed to prepend the base to that path (instead of using the base directly). - The workbench HTML now natively supports a base URL in the form of WORKBENCH_WEB_BASE_URL so no need for VS_BASE patches there anymore. - Upstream added type="image/x-icon" so I did as well. - Move the language patch to the end of the series so it is easier to eventually remove. - Remove the existing NLS config in favor of one that supports extensions. - Upstream deleted webview main.js and inlined it into the HTML so move that code (the parent origin check) into both those HTML files (index.html and index-no-csp.html). - The remaining diff is from changes to the surrounding context or a line was changed slightly by upstream (for example renamed files or new arguments like to the remote authority resolver). * fix: modify product.json before building Code injects this into the client during the build process so it needs to be updated before we build. * fix: update inline script nonces * Update HTML base path test * fix: missing commit Code overrides it with nothing. The date is also already injected. * fix: web extensions breaking when the commit changes By just using the marketplace directly instead of going through the backend. I am not sure what the point is when searching extensions already goes directly to the marketplace anyway. But also remove the prefix that breaks this as well because otherwise existing installations will break.
1 parent eb314ff commit 5ce99f8

24 files changed

+497
-460
lines changed

ci/build/build-release.sh

-37
Original file line numberDiff line numberDiff line change
@@ -98,43 +98,6 @@ bundle_vscode() {
9898

9999
rsync "${rsync_opts[@]}" ./lib/vscode-reh-web-*/ "$VSCODE_OUT_PATH"
100100

101-
# Add the commit, date, our name, links, and enable telemetry. This just makes
102-
# telemetry available; telemetry can still be disabled by flag or setting.
103-
jq --slurp '.[0] * .[1]' "$VSCODE_SRC_PATH/product.json" <(
104-
cat << EOF
105-
{
106-
"enableTelemetry": true,
107-
"commit": "$(cd "$VSCODE_SRC_PATH" && git rev-parse HEAD)",
108-
"quality": "stable",
109-
"date": $(jq -n 'now | todate'),
110-
"codeServerVersion": "$VERSION",
111-
"nameShort": "code-server",
112-
"nameLong": "code-server",
113-
"applicationName": "code-server",
114-
"dataFolderName": ".code-server",
115-
"win32MutexName": "codeserver",
116-
"licenseUrl": "https://github.com/coder/code-server/blob/main/LICENSE",
117-
"win32DirName": "code-server",
118-
"win32NameVersion": "code-server",
119-
"win32AppUserModelId": "coder.code-server",
120-
"win32ShellNameShort": "c&ode-server",
121-
"darwinBundleIdentifier": "com.coder.code.server",
122-
"linuxIconName": "com.coder.code.server",
123-
"reportIssueUrl": "https://github.com/coder/code-server/issues/new",
124-
"documentationUrl": "https://go.microsoft.com/fwlink/?LinkID=533484#vscode",
125-
"keyboardShortcutsUrlMac": "https://go.microsoft.com/fwlink/?linkid=832143",
126-
"keyboardShortcutsUrlLinux": "https://go.microsoft.com/fwlink/?linkid=832144",
127-
"keyboardShortcutsUrlWin": "https://go.microsoft.com/fwlink/?linkid=832145",
128-
"introductoryVideosUrl": "https://go.microsoft.com/fwlink/?linkid=832146",
129-
"tipsAndTricksUrl": "https://go.microsoft.com/fwlink/?linkid=852118",
130-
"newsletterSignupUrl": "https://www.research.net/r/vsc-newsletter",
131-
"linkProtectionTrustedDomains": [
132-
"https://open-vsx.org"
133-
]
134-
}
135-
EOF
136-
) > "$VSCODE_OUT_PATH/product.json"
137-
138101
# Use the package.json for the web/remote server. It does not have the right
139102
# version though so pull that from the main package.json.
140103
jq --slurp '.[0] * {version: .[1].version}' \

ci/build/build-vscode.sh

+52
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,62 @@ MINIFY=${MINIFY-true}
99
main() {
1010
cd "$(dirname "${0}")/../.."
1111

12+
source ./ci/lib.sh
13+
1214
cd lib/vscode
1315

16+
# Set the commit Code will embed into the product.json. We need to do this
17+
# since Code tries to get the commit from the `.git` directory which will fail
18+
# as it is a submodule.
19+
export VSCODE_DISTRO_COMMIT
20+
VSCODE_DISTRO_COMMIT=$(git rev-parse HEAD)
21+
22+
# Add the date, our name, links, and enable telemetry (this just makes
23+
# telemetry available; telemetry can still be disabled by flag or setting).
24+
# This needs to be done before building as Code will read this file and embed
25+
# it into the client-side code.
26+
git checkout product.json # Reset in case the script exited early.
27+
cp product.json product.original.json # Since jq has no inline edit.
28+
jq --slurp '.[0] * .[1]' product.original.json <(
29+
cat << EOF
30+
{
31+
"enableTelemetry": true,
32+
"quality": "stable",
33+
"codeServerVersion": "$VERSION",
34+
"nameShort": "code-server",
35+
"nameLong": "code-server",
36+
"applicationName": "code-server",
37+
"dataFolderName": ".code-server",
38+
"win32MutexName": "codeserver",
39+
"licenseUrl": "https://github.com/coder/code-server/blob/main/LICENSE",
40+
"win32DirName": "code-server",
41+
"win32NameVersion": "code-server",
42+
"win32AppUserModelId": "coder.code-server",
43+
"win32ShellNameShort": "c&ode-server",
44+
"darwinBundleIdentifier": "com.coder.code.server",
45+
"linuxIconName": "com.coder.code.server",
46+
"reportIssueUrl": "https://github.com/coder/code-server/issues/new",
47+
"documentationUrl": "https://go.microsoft.com/fwlink/?LinkID=533484#vscode",
48+
"keyboardShortcutsUrlMac": "https://go.microsoft.com/fwlink/?linkid=832143",
49+
"keyboardShortcutsUrlLinux": "https://go.microsoft.com/fwlink/?linkid=832144",
50+
"keyboardShortcutsUrlWin": "https://go.microsoft.com/fwlink/?linkid=832145",
51+
"introductoryVideosUrl": "https://go.microsoft.com/fwlink/?linkid=832146",
52+
"tipsAndTricksUrl": "https://go.microsoft.com/fwlink/?linkid=852118",
53+
"newsletterSignupUrl": "https://www.research.net/r/vsc-newsletter",
54+
"linkProtectionTrustedDomains": [
55+
"https://open-vsx.org"
56+
]
57+
}
58+
EOF
59+
) > product.json
60+
1461
# Any platform works since we have our own packaging step (for now).
1562
yarn gulp "vscode-reh-web-linux-x64${MINIFY:+-min}"
63+
64+
# Reset so if you develop after building you will not be stuck with the wrong
65+
# commit (the dev client will use `oss-dev` but the dev server will still use
66+
# product.json which will have `stable-$commit`).
67+
git checkout product.json
1668
}
1769

1870
main "$@"

lib/vscode

Submodule vscode updated 1890 files

patches/base-path.diff

+66-107
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,14 @@ 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-
@@ -151,8 +151,10 @@ class RemoteAuthoritiesImpl {
14-
}
13+
@@ -157,7 +157,9 @@ class RemoteAuthoritiesImpl {
1514
return URI.from({
1615
scheme: platform.isWeb ? this._preferredWebSchema : Schemas.vscodeRemoteResource,
17-
- authority: `${host}:${port}`,
18-
- path: `/vscode-remote-resource`,
19-
+ authority: platform.isWeb ? window.location.host : `${host}:${port}`,
16+
authority: `${host}:${port}`,
17+
- path: this._remoteResourcesPath,
2018
+ path: platform.isWeb
21-
+ ? URI.joinPath(URI.parse(window.location.href), `/vscode-remote-resource`).path
22-
+ : `/vscode-remote-resource`,
19+
+ ? (window.location.pathname + "/" + this._remoteResourcesPath).replace(/\/\/+/g, "/")
20+
+ : this._remoteResourcesPath,
2321
query
2422
});
2523
}
@@ -38,40 +36,28 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench-dev.html
3836

3937
<!-- Disable pinch zooming -->
4038
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
41-
@@ -27,23 +27,26 @@
39+
@@ -27,9 +27,9 @@
4240
<meta id="vscode-workbench-builtin-extensions" data-settings="{{WORKBENCH_BUILTIN_EXTENSIONS}}">
4341

4442
<!-- Workbench Icon/Manifest/CSS -->
4543
- <link rel="icon" href="/_static/src/browser/media/favicon-dark-support.svg" />
46-
- <link rel="alternate icon" href="/_static/src/browser/media/favicon.ico" />
44+
- <link rel="alternate icon" href="/_static/src/browser/media/favicon.ico" type="image/x-icon" />
4745
- <link rel="manifest" href="/manifest.json" crossorigin="use-credentials" />
4846
+ <link rel="icon" href="{{BASE}}/_static/src/browser/media/favicon-dark-support.svg" />
49-
+ <link rel="alternate icon" href="{{BASE}}/_static/src/browser/media/favicon.ico" />
47+
+ <link rel="alternate icon" href="{{BASE}}/_static/src/browser/media/favicon.ico" type="image/x-icon" />
5048
+ <link rel="manifest" href="{{VS_BASE}}/manifest.json" crossorigin="use-credentials" />
5149
</head>
5250

5351
<body aria-label="">
54-
</body>
55-
56-
<!-- Startup (do not modify order of script tags!) -->
57-
- <script src="./static/out/vs/loader.js"></script>
58-
- <script src="./static/out/vs/webPackagePaths.js"></script>
59-
+ <script src="{{VS_BASE}}/static/out/vs/loader.js"></script>
60-
+ <script src="{{VS_BASE}}/static/out/vs/webPackagePaths.js"></script>
52+
@@ -39,7 +39,7 @@
53+
<script src="{{WORKBENCH_WEB_BASE_URL}}/out/vs/loader.js"></script>
54+
<script src="{{WORKBENCH_WEB_BASE_URL}}/out/vs/webPackagePaths.js"></script>
6155
<script>
56+
- const baseUrl = new URL('{{WORKBENCH_WEB_BASE_URL}}', window.location.origin).toString();
57+
+ const baseUrl = new URL('{{WORKBENCH_WEB_BASE_URL}}', window.location).toString();
6258
Object.keys(self.webPackagePaths).map(function (key, index) {
63-
- self.webPackagePaths[key] = `${window.location.origin}/static/remote/web/node_modules/${key}/${self.webPackagePaths[key]}`;
64-
+ self.webPackagePaths[key] = new URL(
65-
+ `{{VS_BASE}}/static/remote/web/node_modules/${key}/${self.webPackagePaths[key]}`,
66-
+ window.location,
67-
+ ).toString();
59+
self.webPackagePaths[key] = `${baseUrl}/remote/web/node_modules/${key}/${self.webPackagePaths[key]}`;
6860
});
69-
require.config({
70-
- baseUrl: `${window.location.origin}/static/out`,
71-
+ baseUrl: new URL(`{{VS_BASE}}/static/out`, window.location).toString(),
72-
recordStats: true,
73-
trustedTypesPolicy: window.trustedTypes?.createPolicy('amdLoader', {
74-
createScriptURL(value) {
7561
Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.html
7662
===================================================================
7763
--- code-server.orig/lib/vscode/src/vs/code/browser/workbench/workbench.html
@@ -87,68 +73,32 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.html
8773

8874
<!-- Disable pinch zooming -->
8975
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
90-
@@ -24,10 +24,10 @@
76+
@@ -24,9 +24,9 @@
9177
<meta id="vscode-workbench-auth-session" data-settings="{{WORKBENCH_AUTH_SESSION}}">
9278

9379
<!-- Workbench Icon/Manifest/CSS -->
9480
- <link rel="icon" href="/_static/src/browser/media/favicon-dark-support.svg" />
95-
- <link rel="alternate icon" href="/_static/src/browser/media/favicon.ico" />
81+
- <link rel="alternate icon" href="/_static/src/browser/media/favicon.ico" type="image/x-icon" />
9682
- <link rel="manifest" href="/manifest.json" crossorigin="use-credentials" />
97-
- <link data-name="vs/workbench/workbench.web.main" rel="stylesheet" href="./static/out/vs/workbench/workbench.web.main.css">
9883
+ <link rel="icon" href="{{BASE}}/_static/src/browser/media/favicon-dark-support.svg" />
99-
+ <link rel="alternate icon" href="{{BASE}}/_static/src/browser/media/favicon.ico" />
84+
+ <link rel="alternate icon" href="{{BASE}}/_static/src/browser/media/favicon.ico" type="image/x-icon" />
10085
+ <link rel="manifest" href="{{VS_BASE}}/manifest.json" crossorigin="use-credentials" />
101-
+ <link data-name="vs/workbench/workbench.web.main" rel="stylesheet" href="{{VS_BASE}}/static/out/vs/workbench/workbench.web.main.css">
86+
<link data-name="vs/workbench/workbench.web.main" rel="stylesheet" href="{{WORKBENCH_WEB_BASE_URL}}/out/vs/workbench/workbench.web.main.css">
10287

10388
</head>
104-
105-
@@ -35,14 +35,17 @@
106-
</body>
107-
108-
<!-- Startup (do not modify order of script tags!) -->
109-
- <script src="./static/out/vs/loader.js"></script>
110-
- <script src="./static/out/vs/webPackagePaths.js"></script>
111-
+ <script src="{{VS_BASE}}/static/out/vs/loader.js"></script>
112-
+ <script src="{{VS_BASE}}/static/out/vs/webPackagePaths.js"></script>
113-
<script>
114-
Object.keys(self.webPackagePaths).map(function (key, index) {
115-
- self.webPackagePaths[key] = `${window.location.origin}/static/node_modules/${key}/${self.webPackagePaths[key]}`;
116-
+ self.webPackagePaths[key] = new URL(
117-
+ `{{VS_BASE}}/static/node_modules/${key}/${self.webPackagePaths[key]}`,
118-
+ window.location,
119-
+ ).toString();
120-
});
121-
require.config({
122-
- baseUrl: `${window.location.origin}/static/out`,
123-
+ baseUrl: new URL(`{{VS_BASE}}/static/out`, window.location).toString(),
124-
recordStats: true,
125-
trustedTypesPolicy: window.trustedTypes?.createPolicy('amdLoader', {
126-
createScriptURL(value) {
127-
@@ -55,7 +58,7 @@
128-
<script>
129-
performance.mark('code/willLoadWorkbenchMain');
130-
</script>
131-
- <script src="./static/out/vs/workbench/workbench.web.main.nls.js"></script>
132-
- <script src="./static/out/vs/workbench/workbench.web.main.js"></script>
133-
- <script src="./static/out/vs/code/browser/workbench/workbench.js"></script>
134-
+ <script src="{{VS_BASE}}/static/out/vs/workbench/workbench.web.main.nls.js"></script>
135-
+ <script src="{{VS_BASE}}/static/out/vs/workbench/workbench.web.main.js"></script>
136-
+ <script src="{{VS_BASE}}/static/out/vs/code/browser/workbench/workbench.js"></script>
137-
</html>
13889
Index: code-server/lib/vscode/src/vs/platform/remote/browser/browserSocketFactory.ts
13990
===================================================================
14091
--- code-server.orig/lib/vscode/src/vs/platform/remote/browser/browserSocketFactory.ts
14192
+++ code-server/lib/vscode/src/vs/platform/remote/browser/browserSocketFactory.ts
142-
@@ -274,7 +274,7 @@ export class BrowserSocketFactory implem
93+
@@ -274,6 +274,7 @@ export class BrowserSocketFactory implem
14394

144-
connect(host: string, port: number, query: string, debugLabel: string, callback: IConnectCallback): void {
95+
connect(host: string, port: number, path: string, query: string, debugLabel: string, callback: IConnectCallback): void {
14596
const webSocketSchema = (/^https:/.test(window.location.href) ? 'wss' : 'ws');
146-
- const socket = this._webSocketFactory.create(`${webSocketSchema}://${/:/.test(host) ? `[${host}]` : host}:${port}/?${query}&skipWebSocketFrames=false`, debugLabel);
147-
+ const socket = this._webSocketFactory.create(`${webSocketSchema}://${window.location.host}${window.location.pathname}?${query}&skipWebSocketFrames=false`, debugLabel);
97+
+ path = (window.location.pathname + "/" + path).replace(/\/\/+/g, "/")
98+
const socket = this._webSocketFactory.create(`${webSocketSchema}://${/:/.test(host) ? `[${host}]` : host}:${port}${path}?${query}&skipWebSocketFrames=false`, debugLabel);
14899
const errorListener = socket.onError((err) => callback(err, undefined));
149100
socket.onOpen(() => {
150-
errorListener.dispose();
151-
@@ -282,6 +282,3 @@ export class BrowserSocketFactory implem
101+
@@ -282,6 +283,3 @@ export class BrowserSocketFactory implem
152102
});
153103
}
154104
}
@@ -159,47 +109,56 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
159109
===================================================================
160110
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
161111
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
162-
@@ -253,7 +253,10 @@ export class WebClientServer {
112+
@@ -267,14 +267,10 @@ export class WebClientServer {
163113
return res.end();
164114
}
165115

166-
- const remoteAuthority = req.headers.host;
116+
- let originalHost = req.headers['x-original-host'];
117+
- if (Array.isArray(originalHost)) {
118+
- originalHost = originalHost[0];
119+
- }
120+
- const remoteAuthority = originalHost || req.headers.host;
121+
- if (!remoteAuthority) {
122+
- return serveError(req, res, 400, `Bad request.`);
123+
- }
167124
+ // It is not possible to reliably detect the remote authority on the server
168125
+ // in all cases. Set this to something invalid to make sure we catch code
169126
+ // that is using this when it should not.
170127
+ const remoteAuthority = 'remote';
171128

172-
function escapeAttribute(value: string): string {
173-
return value.replace(/"/g, '&quot;');
174-
@@ -275,6 +278,8 @@ export class WebClientServer {
175-
accessToken: this._environmentService.args['github-auth'],
129+
function asJSON(value: unknown): string {
130+
return JSON.stringify(value).replace(/"/g, '&quot;');
131+
@@ -297,6 +293,8 @@ export class WebClientServer {
176132
scopes: [['user:email'], ['repo']]
177133
} : undefined;
134+
178135
+ const base = relativeRoot(getOriginalUrl(req))
179136
+ const vscodeBase = relativePath(getOriginalUrl(req))
180-
const data = (await util.promisify(fs.readFile)(filePath)).toString()
181-
.replace('{{WORKBENCH_WEB_CONFIGURATION}}', escapeAttribute(JSON.stringify({
182-
remoteAuthority,
183-
@@ -285,6 +290,7 @@ export class WebClientServer {
184-
folderUri: resolveWorkspaceURI(this._environmentService.args['default-folder']),
185-
workspaceUri: resolveWorkspaceURI(this._environmentService.args['default-workspace']),
186-
productConfiguration: <Partial<IProductConfiguration>>{
187-
+ rootEndpoint: base,
188-
codeServerVersion: this._productService.codeServerVersion,
189-
embedderIdentifier: 'server-distro',
190-
extensionsGallery: this._webExtensionResourceUrlTemplate ? {
191-
@@ -297,7 +303,9 @@ export class WebClientServer {
192-
} : undefined
193-
}
194-
})))
195-
- .replace('{{WORKBENCH_AUTH_SESSION}}', () => authSessionInfo ? escapeAttribute(JSON.stringify(authSessionInfo)) : '');
196-
+ .replace('{{WORKBENCH_AUTH_SESSION}}', () => authSessionInfo ? escapeAttribute(JSON.stringify(authSessionInfo)) : '')
197-
+ .replace(/{{BASE}}/g, base)
198-
+ .replace(/{{VS_BASE}}/g, vscodeBase);
199137

200-
const cspDirectives = [
201-
'default-src \'self\';',
202-
@@ -376,3 +384,70 @@ export class WebClientServer {
138+
const workbenchWebConfiguration = {
139+
remoteAuthority,
140+
@@ -308,6 +306,7 @@ export class WebClientServer {
141+
workspaceUri: resolveWorkspaceURI(this._environmentService.args['default-workspace']),
142+
productConfiguration: <Partial<IProductConfiguration>>{
143+
codeServerVersion: this._productService.codeServerVersion,
144+
+ rootEndpoint: base,
145+
embedderIdentifier: 'server-distro',
146+
extensionsGallery: this._webExtensionResourceUrlTemplate ? {
147+
...this._productService.extensionsGallery,
148+
@@ -328,8 +327,10 @@ export class WebClientServer {
149+
const values: { [key: string]: string } = {
150+
WORKBENCH_WEB_CONFIGURATION: asJSON(workbenchWebConfiguration),
151+
WORKBENCH_AUTH_SESSION: authSessionInfo ? asJSON(authSessionInfo) : '',
152+
- WORKBENCH_WEB_BASE_URL: this._staticRoute,
153+
- WORKBENCH_NLS_BASE_URL: nlsBaseUrl ? `${nlsBaseUrl}${this._productService.commit}/${this._productService.version}/` : '',
154+
+ WORKBENCH_WEB_BASE_URL: vscodeBase + this._staticRoute,
155+
+ WORKBENCH_NLS_BASE_URL: vscodeBase + (nlsBaseUrl ? `${nlsBaseUrl}${this._productService.commit}/${this._productService.version}/` : ''),
156+
+ BASE: base,
157+
+ VS_BASE: vscodeBase,
158+
};
159+
160+
161+
@@ -419,3 +420,70 @@ export class WebClientServer {
203162
return res.end(data);
204163
}
205164
}
@@ -286,20 +245,20 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
286245
===================================================================
287246
--- code-server.orig/lib/vscode/src/vs/code/browser/workbench/workbench.ts
288247
+++ code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
289-
@@ -482,6 +482,7 @@ function doCreateUri(path: string, query
248+
@@ -485,6 +485,7 @@ function doCreateUri(path: string, query
290249
});
291250
}
292251

293252
+ path = (window.location.pathname + "/" + path).replace(/\/\/+/g, "/")
294253
return URI.parse(window.location.href).with({ path, query });
295254
}
296255

297-
@@ -493,7 +494,7 @@ function doCreateUri(path: string, query
256+
@@ -496,7 +497,7 @@ function doCreateUri(path: string, query
298257
if (!configElement || !configElementAttribute) {
299258
throw new Error('Missing web configuration element');
300259
}
301-
- const config: IWorkbenchConstructionOptions & { folderUri?: UriComponents; workspaceUri?: UriComponents } = JSON.parse(configElementAttribute);
302-
+ const config: IWorkbenchConstructionOptions & { folderUri?: UriComponents, workspaceUri?: UriComponents } = { ...JSON.parse(configElementAttribute), remoteAuthority: location.host }
260+
- const config: IWorkbenchConstructionOptions & { folderUri?: UriComponents; workspaceUri?: UriComponents; callbackRoute: string } = JSON.parse(configElementAttribute);
261+
+ const config: IWorkbenchConstructionOptions & { folderUri?: UriComponents; workspaceUri?: UriComponents; callbackRoute: string } = { ...JSON.parse(configElementAttribute), remoteAuthority: location.host }
303262

304263
// Create workbench
305264
create(document.body, {
@@ -312,10 +271,10 @@ Index: code-server/lib/vscode/src/vs/workbench/services/extensionResourceLoader/
312271
import { TelemetryLevel } from 'vs/platform/telemetry/common/telemetry';
313272
import { getTelemetryLevel, supportsTelemetry } from 'vs/platform/telemetry/common/telemetryUtils';
314273
-import { RemoteAuthorities } from 'vs/base/common/network';
274+
import { getRemoteServerRootPath } from 'vs/platform/remote/common/remoteHosts';
315275

316276
export const WEB_EXTENSION_RESOURCE_END_POINT = 'web-extension-resource';
317-
318-
@@ -72,7 +71,7 @@ export abstract class AbstractExtensionR
277+
@@ -75,7 +74,7 @@ export abstract class AbstractExtensionR
319278
public getExtensionGalleryResourceURL(galleryExtension: { publisher: string; name: string; version: string }, path?: string): URI | undefined {
320279
if (this._extensionGalleryResourceUrlTemplate) {
321280
const uri = URI.parse(format2(this._extensionGalleryResourceUrlTemplate, { publisher: galleryExtension.publisher, name: galleryExtension.name, version: galleryExtension.version, path: 'extension' }));

0 commit comments

Comments
 (0)