gotta rewrite this shit go

This commit is contained in:
2025-12-21 04:00:47 +01:00
parent f893228ee5
commit 18087b91da
+2 -6
View File
@@ -8,7 +8,7 @@ const LABELS = {
};
export async function GET(
req: NextRequest,
_req: NextRequest,
{ params }: { params: Promise<{ slug: string[] }> },
) {
try {
@@ -20,11 +20,7 @@ export async function GET(
const isComplete = subject && year && period && level;
if (isComplete) {
const protocol =
req.headers.get("x-forwarded-proto") === "https" ? "https" : "http";
const host = req.headers.get("host");
const proxyBase = `${protocol}://${host}/proxy/${subject.slug}/${year}/${period}/${level}`;
const proxyBase = `/proxy/${subject.slug}/${year}/${period}/${level}`;
const makeLink = (type: string) => `${proxyBase}/${type}`;
return NextResponse.json({