Skip to content

Commit 72d1449

Browse files
committed
fix: use protocol-accurate label and description for custom endpoints
Non-HTTPS URLs from customHttpsEndpointUrls were labeled 'Custom HTTPS' with a description mentioning 'HTTPS endpoint' even when the URL used plain HTTP. Now the label and description are conditionally set based on whether the URL actually uses HTTPS.
1 parent bae05b2 commit 72d1449

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

apps/desktop/src/serverExposure.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ describe("resolveDesktopCoreAdvertisedEndpoints", () => {
171171
},
172172
{
173173
id: "manual:http://desktop.example.test:3773",
174-
label: "Custom HTTPS",
174+
label: "Custom endpoint",
175175
provider: {
176176
id: "manual",
177177
label: "Manual",
@@ -187,7 +187,7 @@ describe("resolveDesktopCoreAdvertisedEndpoints", () => {
187187
},
188188
source: "user",
189189
status: "unknown",
190-
description: "User-configured HTTPS endpoint for this desktop backend.",
190+
description: "User-configured endpoint for this desktop backend.",
191191
},
192192
]);
193193
});

apps/desktop/src/serverExposure.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,17 +165,18 @@ export function resolveDesktopCoreAdvertisedEndpoints(
165165

166166
for (const customEndpointUrl of input.customHttpsEndpointUrls ?? []) {
167167
try {
168+
const isHttps = isHttpsEndpointUrl(customEndpointUrl);
168169
endpoints.push(
169170
createManualEndpoint({
170171
id: `manual:${customEndpointUrl}`,
171-
label: "Custom HTTPS",
172+
label: isHttps ? "Custom HTTPS" : "Custom endpoint",
172173
httpBaseUrl: customEndpointUrl,
173174
reachability: "public",
174-
...(isHttpsEndpointUrl(customEndpointUrl)
175-
? ({ hostedHttpsCompatibility: "compatible" } as const)
176-
: {}),
175+
...(isHttps ? ({ hostedHttpsCompatibility: "compatible" } as const) : {}),
177176
status: "unknown",
178-
description: "User-configured HTTPS endpoint for this desktop backend.",
177+
description: isHttps
178+
? "User-configured HTTPS endpoint for this desktop backend."
179+
: "User-configured endpoint for this desktop backend.",
179180
}),
180181
);
181182
} catch {

0 commit comments

Comments
 (0)