Skip to content

Commit 31abbb6

Browse files
committed
fix: only mark custom endpoints as HTTPS-compatible when URL scheme is actually HTTPS
Custom endpoints from T3CODE_DESKTOP_HTTPS_ENDPOINTS were unconditionally marked with hostedHttpsCompatibility: 'compatible', bypassing the automatic classifyHostedHttpsCompatibility check. If a user mistakenly supplies an http:// URL, the endpoint would be incorrectly marked as compatible with the hosted HTTPS app. Now we check the URL protocol first and only override with 'compatible' for actual https: URLs. For http: URLs, the field is omitted, letting the auto-classifier in createAdvertisedEndpoint correctly return 'mixed-content-blocked'.
1 parent 2045416 commit 31abbb6

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

apps/desktop/src/serverExposure.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,13 +156,14 @@ export function resolveDesktopCoreAdvertisedEndpoints(
156156
}
157157

158158
for (const customEndpointUrl of input.customHttpsEndpointUrls ?? []) {
159+
const isHttps = new URL(customEndpointUrl).protocol === "https:";
159160
endpoints.push(
160161
createManualEndpoint({
161162
id: `manual:${customEndpointUrl}`,
162163
label: "Custom HTTPS",
163164
httpBaseUrl: customEndpointUrl,
164165
reachability: "public",
165-
hostedHttpsCompatibility: "compatible",
166+
...(isHttps ? { hostedHttpsCompatibility: "compatible" as const } : {}),
166167
status: "unknown",
167168
description: "User-configured HTTPS endpoint for this desktop backend.",
168169
}),

0 commit comments

Comments
 (0)