fix and update

This commit is contained in:
lendry
2026-07-07 10:29:07 +03:00
parent bd6cd0d798
commit 12f46f572d
10 changed files with 115 additions and 31 deletions

View File

@@ -1,15 +1,8 @@
import { NextRequest, NextResponse } from 'next/server';
import type { NextRequest } from 'next/server';
import { proxyReleaseDownload } from '@/lib/proxy-release-download';
export const runtime = 'nodejs';
function resolveApiBase(request: NextRequest) {
const internal = process.env.INTERNAL_API_URL?.replace(/\/$/, '');
if (internal) return internal;
const origin = request.nextUrl.origin;
return `${origin}/idp-api`;
}
export async function GET(request: NextRequest) {
const target = `${resolveApiBase(request)}/releases/download/windows`;
return NextResponse.redirect(target, 302);
return proxyReleaseDownload(request, 'windows');
}