Skip to content

Commit b0fdbad

Browse files
committed
fixup!: throw error if productConfiguration missing
1 parent 343927c commit b0fdbad

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

patches/proxy-uri.diff

+2-4
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
110110

111111
interface ICredential {
112112
service: string;
113-
@@ -507,6 +508,23 @@ function doCreateUri(path: string, query
113+
@@ -507,6 +508,21 @@ function doCreateUri(path: string, query
114114
} : undefined,
115115
workspaceProvider: WorkspaceProvider.create(config),
116116
urlCallbackProvider: new LocalStorageURLCallbackProvider(config.callbackRoute),
@@ -121,12 +121,10 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
121121
+ const localhostMatch = extractLocalHostUriMetaDataForPortMapping(uri)
122122
+
123123
+ if (localhostMatch) {
124-
+ let baseUrl = `${window.location.protocol}//${window.location.host}`
125124
+ if (config.productConfiguration && config.productConfiguration.proxyEndpointTemplate) {
126125
+ resolvedUri = URI.parse(new URL(config.productConfiguration.proxyEndpointTemplate.replace('{{port}}', localhostMatch.port.toString()), window.location.href).toString())
127126
+ } else {
128-
+ // Manually use code-server's built in /proxy/<port>
129-
+ resolvedUri = URI.parse(`${baseUrl}/proxy/${localhostMatch.port}`)
127+
+ throw new Error(`Failed to resolve external URI: ${uri.toString()}. Could not determine base url because productConfiguration missing.`)
130128
+ }
131129
+ }
132130
+

0 commit comments

Comments
 (0)