From 20815ae21f905c2107dbdaea74eb27779a1acacb Mon Sep 17 00:00:00 2001 From: HotelSync Date: Fri, 27 Mar 2026 17:50:11 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20agent=20download=20URL=20=E2=80=94=20ret?= =?UTF-8?q?urn=20absolute=20api.hotelsync.ru=20URL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Relative /agent-updates/ path was resolving to app.hotelsync.ru (frontend) instead of api.hotelsync.ru, returning HTML instead of .exe Co-Authored-By: Claude Sonnet 4.6 --- backend/src/routes/agent-release.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/src/routes/agent-release.ts b/backend/src/routes/agent-release.ts index e72ff15..eacc829 100644 --- a/backend/src/routes/agent-release.ts +++ b/backend/src/routes/agent-release.ts @@ -13,7 +13,8 @@ const agentRelease: FastifyPluginAsync = async (fastify) => { if (!versionMatch) return reply.code(404).send({ error: 'latest.yml not found or invalid' }) const version = versionMatch[1].trim() const fileName = pathMatch?.[1].trim() ?? `HotelSync Agent Setup ${version}.exe` - return { version, fileName, downloadUrl: `/agent-updates/${encodeURIComponent(fileName)}` } + const host = process.env.API_PUBLIC_URL ?? 'https://api.hotelsync.ru' + return { version, fileName, downloadUrl: `${host}/agent-updates/${encodeURIComponent(fileName)}` } } catch { return reply.code(404).send({ error: 'No release available' }) }