Skip to content

Commit e27b704

Browse files
committed
fix download
1 parent d26baff commit e27b704

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

apps/api/src/rest/routers/desktop.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ app.openapi(
130130

131131
// Build the proxy base URL from the incoming request
132132
const requestUrl = new URL(c.req.url);
133-
const proxyBase = `${requestUrl.protocol}//${requestUrl.host}/desktop/update/download`;
133+
const protocol =
134+
c.req.header("x-forwarded-proto") ?? requestUrl.protocol.replace(":", "");
135+
const proxyBase = `${protocol}://${requestUrl.host}/desktop/update/download`;
134136

135137
// Rewrite each platform's download URL to go through our proxy
136138
for (const [platform, entry] of Object.entries(manifest.platforms)) {

0 commit comments

Comments
 (0)